Package event

Class BlockedEvent

java.lang.Object
event.GameEvent
event.BlockedEvent

public class BlockedEvent extends GameEvent
Provides a representation for an event representing the intersection of a moving entity with an impenetrable entity (Barrier). The blocking event contains the references of the entity and the barrier involved, as well as a string comment.
Author:
Krish Pillai
See Also:
  • Constructor Details

    • BlockedEvent

      public BlockedEvent(EntityModel a, BarrierModel b, String description)
      Constructs an event involving a dynamic entity a and a Barrier b
      Parameters:
      a - the dynamic entity
      b - the barrier
      description - of the event (message)
    • BlockedEvent

      public BlockedEvent(EntityModel a, BarrierModel b)
      Constructor for two-way collision.
      Parameters:
      a - The colliding entity
      b - The other entity involved
    • BlockedEvent

      public BlockedEvent(BlockedEvent e)
      Copy constructor
      Parameters:
      e - the other event
  • Method Details

    • getEntity

      public EntityModel getEntity()
      Getter the first involved entity.
      Returns:
      the colliding entity
    • getBarrier

      public BarrierModel getBarrier()
      Getter for the barrier.
      Returns:
      the barrier
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class GameEvent