Bandidos
|
Public Member Functions | |
GridUserComponent (Grid grid, String gridOccupyTag, int xSize, int ySize) | |
GridUserComponent (Grid grid, String[] gridOccupyTags, int xSize, int ySize) | |
GridTile | getCurrentLocatedTile () |
boolean | isLocated () |
int | getLocationX () |
int | getLocationY () |
void | placeSelfOnLocation (int x, int y) |
void | removeSelfFromLocation () |
Collection< String > | getGridOccupyTags () |
void | addGridOccupyTag (String tag) |
void | removeGridOccupyTag (String tag) |
boolean | hasGridOccupyTag (String tag) |
void | awake () |
Public Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent | |
EngineTween | startTweenOnComponent (Tween tween, TweenStartType tweenStartType) |
Timeline | startTimelineOnComponent (Timeline timeline, boolean updateInGameTime) |
EngineTween | doFloat (TweenableFloat floatToTween, float newValue, float duration, TweenStartType tweenStartType) |
void | stopAllComponentTweens () |
void | initialize (BaseEntity parentEntity) |
BaseEntity | getParentOfComponent () |
boolean | isActive () |
boolean | isDestroyed () |
void | setActiveState (boolean activeState) |
void | destroy () |
void | update (float deltaTime) |
abstract void | awake () |
Public Member Functions inherited from com.mygdx.game.engine.events.EventDispatcher | |
void | addEventListener (String type, IEventReceiver listeningClass) |
void | dispatchEvent (Event event) |
void | removeEventListener (String type, IEventReceiver listener) |
boolean | hasEventListener (String type) |
ArrayList< ListenerItem > | getAllListeners () |
void | destroyAllListeners () |
void | clean () |
Static Public Attributes | |
static final int | NOT_LOCATED_VALUE = -1337 |
Protected Member Functions | |
Grid | getGrid () |
void | destroyed () |
void | updated (float deltaTime) |
void | activeStateChanged () |
Protected Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent | |
abstract void | updated (float deltaTime) |
abstract void | destroyed () |
abstract void | activeStateChanged () |
This class is a component which can be used to place the entity in grid data on 1 or multiple tiles depending on the given size. The way it represents something standing on a tile is by adding the grid occupy tags to the tile it is placed on. This way the tags can be used to determine their current occupy status.
com.mygdx.game.components.GridUserComponent.GridUserComponent | ( | Grid | grid, |
String | gridOccupyTag, | ||
int | xSize, | ||
int | ySize | ||
) |
Creates the grid user component. It needs a grid to be linked to, starter tags to represent its being and a size to know how many tiles to cover when located.
grid | to link with the grid user |
gridOccupyTag | tag it represents to indicate its id when placed on a tile. |
xSize | how many tiles it should cover in the x axis. If the size x is > 1, then the tiles right to the given tile are also set. |
ySize | how many tiles it should cover in the y axis. If the size y is > 1, then the tiles below the given tile are also set. |
com.mygdx.game.components.GridUserComponent.GridUserComponent | ( | Grid | grid, |
String [] | gridOccupyTags, | ||
int | xSize, | ||
int | ySize | ||
) |
Creates the grid user component. It needs a grid to be linked to, starter tags to represent its being and a size to know how many tiles to cover when located.
grid | to link with the grid user |
gridOccupyTags | tags it represents to indicate its id when placed on a tile. |
xSize | how many tiles it should cover in the x axis. If the size x is > 1, then the tiles right to the given tile are also set. |
ySize | how many tiles it should cover in the y axis. If the size y is > 1, then the tiles below the given tile are also set. |
|
protected |
void com.mygdx.game.components.GridUserComponent.addGridOccupyTag | ( | String | tag | ) |
Adds a grid occupy tag to the component and the tiles it is currently placed on.
tag | as occupy tag the component represents |
void com.mygdx.game.components.GridUserComponent.awake | ( | ) |
|
protected |
GridTile com.mygdx.game.components.GridUserComponent.getCurrentLocatedTile | ( | ) |
Returns the current tile this user is located on. If it was not placed, this will return null
|
protected |
Returns the instance of the grid this component is linked to by its constructor
Collection<String> com.mygdx.game.components.GridUserComponent.getGridOccupyTags | ( | ) |
Returns all the grid occupy tags this component represents.
int com.mygdx.game.components.GridUserComponent.getLocationX | ( | ) |
Grid space x axis location this entity stands on.
int com.mygdx.game.components.GridUserComponent.getLocationY | ( | ) |
Grid space y axis location this entity stands on.
boolean com.mygdx.game.components.GridUserComponent.hasGridOccupyTag | ( | String | tag | ) |
Returns whether this component represents the given tag
tag | to compare as occupy tag |
boolean com.mygdx.game.components.GridUserComponent.isLocated | ( | ) |
Returns whether this component is placed on the grid, true if it is, else false.
void com.mygdx.game.components.GridUserComponent.placeSelfOnLocation | ( | int | x, |
int | y | ||
) |
Adds its tags to the tiles it covers and removes them from the one it covered before. This represents the starting location. If the size x is > 1, then the tiles right to the given tile are also set. If the size y is > 1, then the tiles below the given tile are also set.
x | of the tile to start the cover process. |
y | of the tile to start the cover process. |
void com.mygdx.game.components.GridUserComponent.removeGridOccupyTag | ( | String | tag | ) |
Removes a grid occupy tag from the component and the tiles it is currently placed on.
tag | as occupy tag the component represents |
void com.mygdx.game.components.GridUserComponent.removeSelfFromLocation | ( | ) |
Removes its tags from the tile it is currently positioned on. This method will do nothing if this component has not been positioned yet.
|
protected |
|
static |
The value of a location if it has not been located on the grid.