Optimized Ticking and Rendering #5

Merged
CyB3RC0nN0R merged 5 commits from feature/optimized_pipeline into develop 2020-07-01 20:17:13 +02:00
4 changed files with 29 additions and 7 deletions
Showing only changes of commit 7c55e049cf - Show all commits

View File

@ -5,6 +5,8 @@ import java.awt.Graphics2D;
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
import java.awt.Rectangle;
/**
* Represents a food item.
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* <p>
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* Project: <strong>Snake</strong><br>
* File: <strong>Food.java</strong><br>
* Created: <strong>01.07.2020</strong><br>
@ -18,23 +20,35 @@ public final class Food implements Updateable {
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
private final int lengthBonus;
private final Rectangle bounds;
/**
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* Constructs a food item.
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
*
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @param color the color of the food item
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @param lengthBonus the length added to the snake when the food item is eaten
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @param bounds the bounds of the food item
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @since Snake 1.1
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
*/
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
public Food(Color color, int lengthBonus, Rectangle bounds) {
this.color = color;
this.lengthBonus = lengthBonus;
this.bounds = bounds;
}
public void checkCollision(Snake snake) {
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
if (bounds.intersects(snake.getHead())) {}
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
}
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
@Override
public void render(Graphics2D g) {
g.setColor(color);
g.fill(bounds);
}
/**
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @return the length added to the snake when the food item is eaten
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @since Snake 1.1
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
*/
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
public int getLengthBonus() { return lengthBonus; }
/**
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @return the bounds of the food item
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @since Snake 1.1
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
*/
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
public Rectangle getBounds() { return bounds; }
}

delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:42:47 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:13 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:38 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:43:55 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```

View File

@ -55,8 +55,8 @@ public final class FoodFactory {
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
FOOD_LENGTH_BONUSES[seed],
new Rectangle(random.nextInt(width - 100) + 50,
random.nextInt(height - 100) + 50,
seed * 10,
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
seed * 10
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
10 + seed * 5,
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
10 + seed * 5
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
)
);
}

delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:32 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:44 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:44:52 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```

View File

@ -19,6 +19,13 @@ public final class Handler implements Updateable {
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
private volatile Food food;
/**
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* Constructs a handler.
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
*
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @param snake the snake
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @param foodFactory the food factory
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
* @since Snake 1.1
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
*/
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
public Handler(Snake snake, FoodFactory foodFactory) {
this.snake = snake;
this.foodFactory = foodFactory;
@ -29,6 +36,7 @@ public final class Handler implements Updateable {
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
public void tick() {
snake.tick();
food.tick();
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
// Check for food collision
if (snake.getHead().intersects(food.getBounds())) {
snake.addLength(food.getLengthBonus());

delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:09 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:45:16 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```

View File

@ -60,7 +60,7 @@ public class Viewport extends Canvas {
delvh commented 2020-07-01 19:55:38 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:55:38 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:56:50 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:56:50 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:58:09 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:58:09 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 20:04:49 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 20:04:49 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
long time = System.currentTimeMillis();
double dt = (time - lastTime) * 1E-3;
lastTime = time;
delvh commented 2020-07-01 19:55:38 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:56:50 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:58:09 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 20:04:49 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
// TODO: Delta time adjustment
delvh commented 2020-07-01 19:55:38 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:56:50 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:58:09 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 20:04:49 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
gameRoot.tick();
render();
}

delvh commented 2020-07-01 19:55:38 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:55:38 +02:00 (Migrated from github.com)
Review
 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:56:50 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:56:50 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:58:09 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 19:58:09 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 20:04:49 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```
delvh commented 2020-07-01 20:04:49 +02:00 (Migrated from github.com)
Review
	 * @since Snake 1.2
```suggestion * @since Snake 1.2 ```