Whether this Unit has performed its action this turn.
The amount of energy this Unit has (from 0.0 to 100.0).
The amount of food this Unit is holding.
String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data.
A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set.
The Job this Unit was recruited to do.
Any strings logged will be stored here. Intended for debugging.
The amount of materials this Unit is holding.
The tile this Unit is moving to. This only applies to neutral fresh humans spawned on the road. Otherwise, the tile this Unit is on.
How many moves this Unit has left this turn.
The Player that owns and can control this Unit, or null if the Unit is neutral.
The Units in the same squad as this Unit. Units in the same squad attack and defend together.
Whether this Unit is starving. Starving Units regenerate energy at half the rate they normally would while resting.
The Tile this Unit is on.
The number of turns before this Unit dies. This only applies to neutral fresh humans created from combat. Otherwise, 0.
Attacks an adjacent Tile. Costs an action for each Unit in this Unit's squad. Units in the squad without an action don't participate in combat. Units in combat cannot move afterwards. Attacking structures will not give materials.
The Tile to attack.
True if successfully attacked, false otherwise.
Changes this Unit's Job. Must be at max energy (100) to change Jobs.
The name of the Job to change to.
True if successfully changed Jobs, false otherwise.
Constructs a Structure on an adjacent Tile.
The Tile to construct the Structure on. It must have enough materials on it for a Structure to be constructed.
The type of Structure to construct on that Tile.
True if successfully constructed a structure, false otherwise.
Converts an adjacent Unit to your side.
The Tile with the Unit to convert.
True if successfully converted, false otherwise.
Removes materials from an adjacent Tile's Structure. You cannot
deconstruct friendly structures (see Unit.attack
).
The Tile to deconstruct. It must have a Structure on it.
True if successfully deconstructed, false otherwise.
Drops some of the given resource on or adjacent to the Unit's Tile. Does not count as an action.
The Tile to drop materials/food on.
The type of resource to drop ('materials' or 'food').
The amount of the resource to drop. Amounts <= 0 will drop as much as possible.
True if successfully dropped the resource, false otherwise.
Harvests the food on an adjacent Tile.
The Tile you want to harvest.
True if successfully harvested, false otherwise.
Adds a message to this GameObject's logs. Intended for your own debugging purposes, as strings stored here are saved in the gamelog.
A string to add to this GameObject's log. Intended for debugging.
Moves this Unit from its current Tile to an adjacent Tile.
The Tile this Unit should move to.
True if it moved, false otherwise.
Picks up some materials or food on or adjacent to the Unit's Tile. Does not count as an action.
The Tile to pickup materials/food from.
The type of resource to pickup ('materials' or 'food').
The amount of the resource to pickup. Amounts <= 0 will pickup as much as possible.
True if successfully picked up a resource, false otherwise.
Regenerates energy. Must be in range of a friendly shelter to rest. Costs an action. Units cannot move after resting.
True if successfully rested, false otherwise.
A toString override for easier debugging.
A human readable representation of the game object.
Generated using TypeDoc
A unit in the game.