Package event

Class GameEvent

java.lang.Object
event.GameEvent
Direct Known Subclasses:
BlockedEvent, CollisionEvent, MessageEvent, OutOfBoundsEvent

public class GameEvent extends Object
Provides a representation for any game event. Contains a description of the event.
Author:
Krish Pillai
  • Constructor Details

    • GameEvent

      public GameEvent(EntityModel a, EntityModel b, String description)
      Constructor for an event involving two entities.
      Parameters:
      a - the first entity
      b - the second entity
      description - string describing the event
      See Also:
    • GameEvent

      public GameEvent(EntityModel a, EntityModel b)
      Constructor for an event involving two entities.
      Parameters:
      a - the first entity
      b - the second entity
      See Also:
    • GameEvent

      public GameEvent(GameEvent that)
      Copy constructor
      Parameters:
      that - the other event
  • Method Details

    • getDescription

      public String getDescription()
      Getter for the description
      Returns:
      description a message
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object