Behaviour Engine
Class for applying MetaBehaviours to GameEntity-s.
This class is basically a facade for several boilerplate methods. The key idea is that applying a behaviour to an entity requires accessing its GameEntity.BehaviourEntity, which at call-site is too verbose and error-prone.
Another feature this class provides is implicitly wrapping some behaviours into an ExpiringBehaviour, which allows applying temporary behaviours.
Constructors
Functions
Link copied to clipboard
final Unit applyBurningBehaviour(GameEntity entity, Long attackPeriodMillis, Integer attack, Long durationMillis)
Content copied to clipboard
Applies expiring BurningBehaviour to entity.
Link copied to clipboard
final Unit applyConfusedBehaviour(GameEntity entity, Long durationMillis)
Content copied to clipboard
Applies expiring ConfusedBehaviour to entity.
Link copied to clipboard
final Unit applyDirectAttackHeroBehaviour(GameEntity entity, Long movePeriodMillis)
Content copied to clipboard
Applies DirectAttackHeroBehaviour to entity.
Link copied to clipboard
final Unit applyDirectFleeFromHeroBehaviour(GameEntity entity, Long movePeriodMillis)
Content copied to clipboard
Applies DirectFleeFromHeroBehaviour to entity.
Link copied to clipboard
final Unit applyFrozenBehaviour(GameEntity entity, Double slowDownCoefficient, Long durationMillis)
Content copied to clipboard
Applies expiring FrozenBehaviour to entity.
Link copied to clipboard
final Unit applyUponSeeingBehaviour(GameEntity entity, GameEntity targetEntity, Integer seeingDepth, Function1<Behaviour, Behaviour> createSeeingBehaviour)
Content copied to clipboard
Applies UponSeeingBehaviour to entity.