Class ServerRobot
java.lang.Object
za.co.wethinkcode.robots.server.serverRobot.ServerRobot
- All Implemented Interfaces:
WorldObject,Robot
- Direct Known Subclasses:
BoringServerBot
Server ClientRobot class. Will evaluate as logically equal to a client robot if they have the same name
-
Nested Class Summary
Nested classes/interfaces inherited from interface za.co.wethinkcode.robots.server.worldinfo.WorldObject
WorldObject.WorldObjectType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Integerprotected Integerprotected Stringprotected RobotKindprotected RobotStateprotected WorldObject.WorldObjectType -
Constructor Summary
ConstructorsConstructorDescriptionEmpty Constructor for the server robotsServerRobot(String name, RobotKind kind, Integer maxShieldStrength, Integer maximumShots) Constructor overload for building a Server robot from its kind, shieldStrength and Maximum shotsServerRobot(String name, RobotKind kind, Integer maxShieldStrength, Integer maximumShots, WorldState worldState) Best constructor for server side bots that allows for spawn finding -
Method Summary
Modifier and TypeMethodDescriptionbooleanallows Direct Comparison between Server Robot and Client RobotGets the kind of robot that this robot isGetter for the robot's stateStandard getter for a server robot's statusgetType()Get the type of this server botinthashCode()voidsetRobotStatus(RobotStatus robotStatus) Setter for a server robot's statusvoidsetState(RobotState robotState) Easy setter for updating a robot's state
-
Field Details
-
name
-
worldObjectType
-
robotKind
-
maxShieldStrength
-
maximumShots
-
robotState
-
-
Constructor Details
-
ServerRobot
public ServerRobot()Empty Constructor for the server robots
-
-
Method Details
-
setState
Easy setter for updating a robot's state- Parameters:
robotState- the state that is being changed to
-
getRobotStatus
Standard getter for a server robot's status- Specified by:
getRobotStatusin interfaceRobot- Returns:
- this serverRobot's
RobotStatus
-
getRobotState
Getter for the robot's state- Returns:
- the robot's state
-
equals
allows Direct Comparison between Server Robot and Client Robot -
hashCode
public int hashCode() -
getType
Get the type of this server bot- Specified by:
getTypein interfaceWorldObject- Returns:
- always returns robot
-
getRobotKind
Description copied from interface:RobotGets the kind of robot that this robot is- Specified by:
getRobotKindin interfaceRobot- Returns:
- which kind of robot this is
-