M - The model feature.public class StateHelper<M extends EntityModelHelper> extends StateAbstract implements TileCollidableListener
| Modifier and Type | Field and Description |
|---|---|
protected Animatable |
animatable
Animator reference.
|
protected Animation |
animation
State animation data.
|
protected Body |
body
Body reference.
|
protected Collidable |
collidable
Collidable reference.
|
protected InputDeviceControl |
input
Input control reference.
|
protected Mirrorable |
mirrorable
Mirrorable reference.
|
protected M |
model
Entity model reference.
|
protected Rasterable |
rasterable
Rasterable reference.
|
protected TileCollidable |
tileCollidable
Tile collidable reference.
|
protected Transformable |
transformable
Transformable reference.
|
| Modifier | Constructor and Description |
|---|---|
protected |
StateHelper(M model,
Animation animation)
Create the state.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enter() |
void |
exit() |
protected boolean |
is(AnimState state)
Check if is anim state.
|
protected boolean |
is(Mirror mirror)
Check if is current mirror state.
|
protected boolean |
isChangingDirectionHorizontal(Force force)
Check if checking horizontal direction side.
|
protected boolean |
isCollideX()
Check if horizontal collide.
|
protected boolean |
isCollideY()
Check if vertical collide.
|
protected boolean |
isFire(Integer index)
Check if fire button is enabled.
|
protected boolean |
isFireOnce(Integer index)
Check if fire button is enabled once.
|
protected boolean |
isGo()
Check if going somewhere.
|
protected boolean |
isGoDown()
Check if going down.
|
protected boolean |
isGoDownOnce()
Check if going down one time.
|
protected boolean |
isGoHorizontal()
Check if going horizontally in any way.
|
protected boolean |
isGoLeft()
Check if going left.
|
protected boolean |
isGoLeftOnce()
Check if going left once.
|
protected boolean |
isGoNone()
Check if going nowhere.
|
protected boolean |
isGoRight()
Check if going right.
|
protected boolean |
isGoRightOnce()
Check if going right once.
|
protected boolean |
isGoUp()
Check if going up.
|
protected boolean |
isGoUpOnce()
Check if going up one time.
|
protected boolean |
isGoVertical()
Check if going vertically in any way.
|
protected void |
mirrorHorizontal()
Perform horizontal mirroring.
|
void |
notifyTileCollided(CollisionResult result,
CollisionCategory category) |
protected void |
onCollided(CollisionResult result,
CollisionCategory category)
Called on collided.
|
void |
update(double extrp) |
protected void |
updateMirrorHorizontal()
Update mirror on horizontal axis (perform mirror when going on the opposite side).
|
protected void |
updateMirrorVertical()
Update mirror on vertical axis (perform mirror when going on the opposite side).
|
addTransition, checkTransitions, clearTransitions, postUpdateprotected final M extends EntityModelHelper model
protected final Animation animation
protected final InputDeviceControl input
protected final Transformable transformable
protected final Mirrorable mirrorable
protected final Rasterable rasterable
protected final Body body
protected final Animatable animatable
protected final TileCollidable tileCollidable
protected final Collidable collidable
protected void onCollided(CollisionResult result, CollisionCategory category)
result - The collided tile.category - The collided axis.protected void mirrorHorizontal()
protected void updateMirrorHorizontal()
protected void updateMirrorVertical()
protected final boolean is(AnimState state)
state - The expected anim state.true if is state, false else.protected final boolean is(Mirror mirror)
mirror - The expected mirror to be.true if is mirror, false else.protected final boolean isGo()
true if not going to move, false else.protected final boolean isGoNone()
true if not going to move, false else.protected final boolean isGoHorizontal()
true if going to left or right, false else.protected final boolean isGoLeft()
true if going to left, false else.protected final boolean isGoRight()
true if going to right, false else.protected final boolean isGoVertical()
true if going to up or down, false else.protected final boolean isGoUp()
true if going to up, false else.protected final boolean isGoDown()
true if going to down, false else.protected final boolean isGoUpOnce()
true if going to up, false else.protected final boolean isGoDownOnce()
true if going to down, false else.protected final boolean isGoLeftOnce()
true if going to left, false else.protected final boolean isGoRightOnce()
true if going to right, false else.protected final boolean isFire(Integer index)
index - The button index (must not be null, must be positive).true if active, false else.protected final boolean isFireOnce(Integer index)
index - The button index (must not be null, must be positive).true if active, false else.protected final boolean isChangingDirectionHorizontal(Force force)
force - The force reference.true if going to the opposite, false else.protected final boolean isCollideX()
true if horizontal collide, false else.protected final boolean isCollideY()
true if vertical collide, false else.public void exit()
exit in interface Stateexit in class StateAbstractpublic void notifyTileCollided(CollisionResult result, CollisionCategory category)
notifyTileCollided in interface TileCollidableListenerCopyright © 2020 Byron 3D Games Studio. All rights reserved.