updated javadoc syntax in some places, add javadoc to game.player and game.weapon
This commit is contained in:
parent
8415739d18
commit
848fccbefd
@ -19,7 +19,7 @@ public interface Action {
|
||||
boolean isPossible();
|
||||
|
||||
/**
|
||||
* Used by {@link Move}, {@link Shot} and {@link DropObject} to list all direction when the action is possible
|
||||
* Used by {@link Move}, {@link Shot} and {@link DropObject} to list all direction where the action is possible
|
||||
* @return a list a point where the action is possible (not block by a wall per example)
|
||||
*/
|
||||
List<Point> getValidPoint();
|
||||
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Package containing all about Grid construction
|
||||
*/
|
||||
package fr.lnl.game.server.games.grid.build;
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Package containing all the elements that can be arranged in a grid
|
||||
*/
|
||||
package fr.lnl.game.server.games.grid.elements;
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Package containing all about Grid components
|
||||
*/
|
||||
package fr.lnl.game.server.games.grid;
|
@ -86,7 +86,7 @@ public abstract class AbstractPlayer implements Player {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPosition(Point position){
|
||||
public void setPosition(/* NotNull */ Point position){
|
||||
if(position == null){
|
||||
throw new IllegalArgumentException("Position is null");
|
||||
}
|
||||
|
@ -3,6 +3,9 @@ package fr.lnl.game.server.games.player;
|
||||
import fr.lnl.game.server.games.weapon.Firearm;
|
||||
import fr.lnl.game.server.games.weapon.Weapon;
|
||||
|
||||
/**
|
||||
* ClassPlayer contains all data about the cost of an action or the cost of a damage
|
||||
*/
|
||||
public enum ClassPlayer {
|
||||
|
||||
DEFAULT(800, 25, 20, 30, 40, 10, 80, 40, 20, 15, new Firearm()),
|
||||
|
@ -3,11 +3,18 @@ package fr.lnl.game.server.games.player;
|
||||
import fr.lnl.game.server.games.action.Action;
|
||||
import fr.lnl.game.server.utils.Point;
|
||||
|
||||
/**
|
||||
* Super class of all Computer players
|
||||
*/
|
||||
public abstract class ComputerPlayer extends AbstractPlayer {
|
||||
|
||||
public ComputerPlayer(Integer id, Point point, ClassPlayer classPlayer) {
|
||||
super(id, point, false, classPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call when an AI need to choose an action to execute
|
||||
* @return the chosen action
|
||||
*/
|
||||
public abstract Action choseAction();
|
||||
}
|
||||
|
@ -2,6 +2,11 @@ package fr.lnl.game.server.games.player;
|
||||
|
||||
import fr.lnl.game.server.utils.Point;
|
||||
|
||||
/**
|
||||
* Instance of Human Player.<br>
|
||||
* A human player choose an action to execute by using mouse or keyboard.<br>
|
||||
* Human Player don't implement choseAction cause this method is executed on client part
|
||||
*/
|
||||
public class HumanPlayer extends AbstractPlayer {
|
||||
|
||||
public HumanPlayer(Integer id, Point point, ClassPlayer classPlayer) {
|
||||
|
@ -12,6 +12,10 @@ public class RandomComputerPlayer extends ComputerPlayer {
|
||||
super(id,point, classPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Choose an action fully randomly
|
||||
* @return an action between all available
|
||||
*/
|
||||
@Override
|
||||
public Action choseAction() {
|
||||
Action action = null;
|
||||
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Package storing all players classes and as well AI behavior
|
||||
*/
|
||||
package fr.lnl.game.server.games.player;
|
@ -4,8 +4,14 @@ public interface Weapon {
|
||||
|
||||
int getBullet();
|
||||
|
||||
/**
|
||||
* @return distance a bullet can go horizontally
|
||||
*/
|
||||
int getHorizontalDistance();
|
||||
|
||||
/**
|
||||
* @return distance a bullet can go vertically
|
||||
*/
|
||||
int getVerticalDistance();
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Package containing all bout player's weapons
|
||||
*/
|
||||
package fr.lnl.game.server.games.weapon;
|
Loading…
Reference in New Issue
Block a user