Resolves checkstyle errors for dao data-bus data-locality data-mapper data-transfer-object decorator (#1067)
* Reduces checkstyle errors in dao * Reduces checkstyle errors in data-bus * Reduces checkstyle errors in data-locality * Reduces checkstyle errors in data-mapper * Reduces checkstyle errors in data-transfer-object * Reduces checkstyle errors in decorator
This commit is contained in:
committed by
Ilkka Seppälä
parent
eae09fc07e
commit
01e489c77b
@ -28,22 +28,21 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Use the Data Locality pattern is when you have a performance problem.
|
||||
* Take advantage of that to improve performance by increasing data locality — keeping data in
|
||||
* contiguous memory in the order that you process it.
|
||||
*
|
||||
* Example: Game loop that processes a bunch of game entities.
|
||||
* Those entities are decomposed into different domains
|
||||
* — AI, physics, and rendering — using the Component pattern.
|
||||
* Use the Data Locality pattern is when you have a performance problem. Take advantage of that to
|
||||
* improve performance by increasing data locality — keeping data in contiguous memory in the order
|
||||
* that you process it.
|
||||
*
|
||||
* <p>Example: Game loop that processes a bunch of game entities. Those entities are decomposed
|
||||
* into different domains — AI, physics, and rendering — using the Component pattern.
|
||||
*/
|
||||
public class Application {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);
|
||||
|
||||
private static final int NUM_ENTITIES = 5;
|
||||
|
||||
/**
|
||||
* Start game loop with each component have NUM_ENTITIES instance
|
||||
* Start game loop with each component have NUM_ENTITIES instance.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
LOGGER.info("Start Game Application using Data-Locality pattern");
|
||||
|
@ -30,14 +30,14 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The game Entity maintains a big array of pointers .
|
||||
* Each spin of the game loop, we need to run the following:
|
||||
* The game Entity maintains a big array of pointers . Each spin of the game loop, we need to run
|
||||
* the following:
|
||||
*
|
||||
* Update the AI components .
|
||||
* <p>Update the AI components.
|
||||
*
|
||||
* Update the physics components for them.
|
||||
* <p>Update the physics components for them.
|
||||
*
|
||||
* Render them using their render components.
|
||||
* <p>Render them using their render components.
|
||||
*/
|
||||
public class GameEntity {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(GameEntity.class);
|
||||
@ -47,7 +47,7 @@ public class GameEntity {
|
||||
private final RenderComponentManager renderComponentManager;
|
||||
|
||||
/**
|
||||
* Init components
|
||||
* Init components.
|
||||
*/
|
||||
public GameEntity(int numEntities) {
|
||||
LOGGER.info("Init Game with #Entity : {}", numEntities);
|
||||
@ -57,7 +57,7 @@ public class GameEntity {
|
||||
}
|
||||
|
||||
/**
|
||||
* start all component
|
||||
* start all component.
|
||||
*/
|
||||
public void start() {
|
||||
LOGGER.info("Start Game");
|
||||
@ -67,7 +67,7 @@ public class GameEntity {
|
||||
}
|
||||
|
||||
/**
|
||||
* update all component
|
||||
* update all component.
|
||||
*/
|
||||
public void update() {
|
||||
LOGGER.info("Update Game Component");
|
||||
@ -80,5 +80,5 @@ public class GameEntity {
|
||||
// Draw to screen.
|
||||
renderComponentManager.render();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -27,14 +27,14 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Implementation of AI component for Game
|
||||
* Implementation of AI component for Game.
|
||||
*/
|
||||
public class AiComponent implements Component {
|
||||
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AiComponent.class);
|
||||
|
||||
/**
|
||||
* Update ai component
|
||||
* Update ai component.
|
||||
*/
|
||||
@Override
|
||||
public void update() {
|
||||
|
@ -24,7 +24,7 @@
|
||||
package com.iluwatar.data.locality.game.component;
|
||||
|
||||
/**
|
||||
* Implement different Game component update and render process
|
||||
* Implement different Game component update and render process.
|
||||
*/
|
||||
public interface Component {
|
||||
|
||||
|
@ -27,13 +27,14 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Implementation of Physics Component of Game
|
||||
* Implementation of Physics Component of Game.
|
||||
*/
|
||||
public class PhysicsComponent implements Component {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(PhysicsComponent.class);
|
||||
|
||||
/**
|
||||
* update physics component of game
|
||||
* update physics component of game.
|
||||
*/
|
||||
@Override
|
||||
public void update() {
|
||||
|
@ -27,7 +27,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Implementation of Render Component of Game
|
||||
* Implementation of Render Component of Game.
|
||||
*/
|
||||
public class RenderComponent implements Component {
|
||||
|
||||
@ -39,7 +39,7 @@ public class RenderComponent implements Component {
|
||||
}
|
||||
|
||||
/**
|
||||
* render
|
||||
* render.
|
||||
*/
|
||||
@Override
|
||||
public void render() {
|
||||
|
@ -29,7 +29,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* AI component manager for Game
|
||||
* AI component manager for Game.
|
||||
*/
|
||||
public class AiComponentManager {
|
||||
|
||||
@ -46,7 +46,7 @@ public class AiComponentManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* start AI component of Game
|
||||
* start AI component of Game.
|
||||
*/
|
||||
public void start() {
|
||||
LOGGER.info("Start AI Game Component");
|
||||
@ -56,7 +56,7 @@ public class AiComponentManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Update AI component of Game
|
||||
* Update AI component of Game.
|
||||
*/
|
||||
public void update() {
|
||||
LOGGER.info("Update AI Game Component");
|
||||
|
@ -46,7 +46,7 @@ public class PhysicsComponentManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Start physics component of Game
|
||||
* Start physics component of Game.
|
||||
*/
|
||||
public void start() {
|
||||
LOGGER.info("Start Physics Game Component ");
|
||||
@ -57,7 +57,7 @@ public class PhysicsComponentManager {
|
||||
|
||||
|
||||
/**
|
||||
* Update physics component of Game
|
||||
* Update physics component of Game.
|
||||
*/
|
||||
public void update() {
|
||||
LOGGER.info("Update Physics Game Component ");
|
||||
|
@ -29,7 +29,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Render component manager for Game
|
||||
* Render component manager for Game.
|
||||
*/
|
||||
public class RenderComponentManager {
|
||||
|
||||
@ -46,7 +46,7 @@ public class RenderComponentManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Start render component
|
||||
* Start render component.
|
||||
*/
|
||||
public void start() {
|
||||
LOGGER.info("Start Render Game Component ");
|
||||
@ -57,7 +57,7 @@ public class RenderComponentManager {
|
||||
|
||||
|
||||
/**
|
||||
* render component
|
||||
* render component.
|
||||
*/
|
||||
public void render() {
|
||||
LOGGER.info("Update Render Game Component ");
|
||||
|
Reference in New Issue
Block a user