Class StateEntity
java.lang.Object
rekit.logic.gameelements.GameElement
rekit.logic.gameelements.entities.Entity
rekit.logic.gameelements.entities.StateEntity
- All Implemented Interfaces:
Collidable
- Direct Known Subclasses:
Player
This class represents a special kind of
Entity
, a Entity
with
inner state. All will be managed by this State
.- Author:
- Dominik Fuchss
-
Nested Class Summary
Nested classes/interfaces inherited from interface rekit.logic.Collidable
Collidable.Optional
-
Field Summary
Fields inherited from class rekit.logic.gameelements.entities.Entity
invincibility, lives
Fields inherited from class rekit.logic.gameelements.GameElement
deleteMe, deltaTime, team, visible
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
StateEntity
(Vec startPos, Vec vel, Vec size, Team team) Constructor that initializes attributes and takes a start position. -
Method Summary
Modifier and TypeMethodDescriptionvoid
collidedWithSolid
(Frame collision, Direction dir) This implementation will ensure that no entity is able to fall through the ground or into another Object.final EntityState
Return the Entities current EntitiyState that determines its jump behavior.protected final void
This method will calculate the next position of the Entity depending on the velocity.final void
setEntityState
(EntityState value) Set the Entities EntitiyState that determines its jump behavior.Methods inherited from class rekit.logic.gameelements.entities.Entity
addDamage, getLives, isVisible, logicLoop, setLives
Methods inherited from class rekit.logic.gameelements.GameElement
checkCollision, create, destroy, getDeleteMe, getFrame, getPos, getScene, getSize, getTeam, getVel, getZ, getZHint, init, internalRender, isAddableToGroup, killBoost, reactToCollision, render, setPos, setScene, setSize, setVel
-
Constructor Details
-
StateEntity
Constructor that initializes attributes and takes a start position.- Parameters:
startPos
- the position this entity shall be invel
- the velocitysize
- the sizeteam
- the team
-
-
Method Details
-
setEntityState
Set the Entities EntitiyState that determines its jump behavior.- Parameters:
value
- the new EntityState
-
getEntityState
Return the Entities current EntitiyState that determines its jump behavior.- Returns:
- the state
-
innerLogicLoop
protected final void innerLogicLoop()This method will calculate the next position of the Entity depending on the velocity.- Overrides:
innerLogicLoop
in classEntity
-
collidedWithSolid
Description copied from class:Entity
This implementation will ensure that no entity is able to fall through the ground or into another Object.- Specified by:
collidedWithSolid
in interfaceCollidable
- Overrides:
collidedWithSolid
in classEntity
- Parameters:
collision
- the Frame of the GameElement that was collided ondir
- the direction of this GameElement where the collision took place
-