Skip to content

Commit

Permalink
format code, add missing javadoc information
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasstarsz committed May 20, 2021
1 parent cb07fc3 commit bd98016
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public static String illegalAction(Class<?> className) {
}

/**
* Gets a string starting with {@code "The game crashed, due to "}, and adds the specified error message to the end.
* Gets a string starting with {@code "The game crashed, due to "}, and adds the specified error message to the
* end.
*
* @param errorMessage The error message to add to the end of the returned string.
* @return The generated error message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public static Path2D.Float createPath(Pointf[] pts) {

/**
* Checks for equality in length and point values between two {@link Path2D} objects.
*
* <p>
* Order does not matter for equality checking.
*
* @param path1 The first {@code Path2D} specified.
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/io/github/lucasstarsz/fastj/math/Maths.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ public static boolean floatEquals(float a, float b) {
/**
* Linearly interpolates between x and y, by the interpolation point t.
*
* @param x The first {@code float} value.
* @param y THe second {@code float} value.
* @param x The starting value.
* @param y The end value.
* @param t The interpolation value to work with (preferably within a range of 0.0 to 1.0).
* @return The lerped value
*/
public static float lerp(float x, float y, float t) {
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/io/github/lucasstarsz/fastj/math/Point.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public static int cross(Point p, Point p1) {
* the {@code Point} version of the calculation. If you want the rotation calculated with floating-point math, use
* {@link Point#rotate(Point, float)} instead.
*
* @param p The point to rotate.
* @param angle The angle to rotate by, in degrees.
* @return A rotated version of the original {@code Point}.
*/
Expand All @@ -207,7 +208,9 @@ public static Point integerRotate(Point p, int angle) {
* This rotation method rotates about the specified {@code center}. If you need to rotate about the origin, use
* {@link #rotate(Point, float)}.
*
* @param angle The angle to rotate by, in degrees.
* @param p The point to rotate.
* @param angle The angle to rotate by, in degrees.
* @param center The point to rotate about.
* @return A rotated version of the original {@code Pointf}.
*/
public static Point integerRotate(Point p, float angle, Point center) {
Expand All @@ -231,6 +234,7 @@ public static Point integerRotate(Point p, float angle, Point center) {
* returns the {@code Pointf} version of the calculation. If you want the rotation calculated with integer math, use
* {@link Point#integerRotate(Point, int)} instead.
*
* @param p The point to rotate.
* @param angle The angle to rotate by, in degrees.
* @return A rotated version of the original {@code Point}, as a {@code Pointf}.
*/
Expand All @@ -250,7 +254,9 @@ public static Pointf rotate(Point p, float angle) {
* This rotation method rotates about the specified {@code center}. If you need to rotate about the origin, use
* {@link #rotate(Point, float)}.
*
* @param angle The angle to rotate by, in degrees.
* @param p The point to rotate.
* @param angle The angle to rotate by, in degrees.
* @param center The point to rotate around.
* @return A rotated version of the original {@code Pointf}.
*/
public static Pointf rotate(Point p, float angle, Pointf center) {
Expand Down Expand Up @@ -494,7 +500,8 @@ public Point rotate(int angle) {
* This rotation method rotates about the specified {@code center}. If you need to rotate about the origin, use
* {@link #rotate(int)}.
*
* @param angle The angle to rotate by, in degrees.
* @param angle The angle to rotate by, in degrees.
* @param center The point to rotate about.
* @return The {@code Pointf} with the rotated values.
*/
public Point rotate(float angle, Point center) {
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/io/github/lucasstarsz/fastj/math/Pointf.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public static float cross(Pointf p, Pointf p1) {
* This rotation method rotates about the origin, {@code (0, 0)}. If you need to rotate about a point that is not
* the origin, use {@link #rotate(float, Pointf)}.
*
* @param p The point to rotate.
* @param angle The angle to rotate by, in degrees.
* @return A rotated version of the original {@code Pointf}.
*/
Expand All @@ -218,7 +219,9 @@ public static Pointf rotate(Pointf p, float angle) {
* This rotation method rotates about the specified {@code center}. If you need to rotate about the origin, use
* {@link #rotate(Pointf, float)}.
*
* @param angle The angle to rotate by, in degrees.
* @param p The point to rotate.
* @param angle The angle to rotate by, in degrees.
* @param center The point to rotate around.
* @return A rotated version of the original {@code Pointf}.
*/
public static Pointf rotate(Pointf p, float angle, Pointf center) {
Expand Down Expand Up @@ -452,7 +455,8 @@ public Pointf rotate(float angle) {
* This rotation method rotates about the specified {@code center}. If you need to rotate about the origin, use
* {@link #rotate(float)}.
*
* @param angle The angle to rotate by, in degrees.
* @param angle The angle to rotate by, in degrees.
* @param center The point to rotate around.
* @return The {@code Pointf} with the rotated values.
*/
public Pointf rotate(float angle, Pointf center) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public void keyTyped(KeyEvent e) {
* Processes the specified key event for the specified scene, based on its event type.
*
* @param scene The scene to fire the event to.
* @param event The key event to process.
* @param event The key event to process.
*/
public static void processEvent(Scene scene, KeyEvent event) {
KeyEventProcessor.get(event.getID()).accept(scene, event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import java.awt.event.KeyEvent;

/**
* Based on the {@link KeyEvent} class, the {@code Key} class defines better-looking
* names for keyboard input keycodes.
* Based on the {@link KeyEvent} class, the {@code Key} class defines better-looking names for keyboard input keycodes.
*
* @author Andrew Dey
* @version 1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public void mouseExited(MouseEvent e) {
* Processes the specified mouse event for the specified scene, based on its event type.
*
* @param scene The scene to fire the event to.
* @param event The mouse event to process.
* @param event The mouse event to process.
*/
public static void processEvent(Scene scene, MouseEvent event) {
MouseEventProcessor.get(event.getID()).accept(scene, event);
Expand Down

0 comments on commit bd98016

Please sign in to comment.