Package event

Class CollisionEvent

java.lang.Object
event.GameEvent
event.CollisionEvent

public class CollisionEvent extends GameEvent
Provides a representation for a two-way collision between entities. The collision event contains the references of the colliding bodies, and a string comment.
Author:
Krish Pillai
  • Constructor Details

    • CollisionEvent

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

      public CollisionEvent(EntityModel a, EntityModel b, String comment)
      Constructor for two-way collision.
      Parameters:
      a - The colliding entity
      b - The other entity involved
      comment - , message, or descriptor for the event
    • CollisionEvent

      public CollisionEvent(CollisionEvent e)
      Copy constructor
      Parameters:
      e - The other event
  • Method Details

    • getA

      public EntityModel getA()
      Getter the first involved entity.
      Returns:
      entity
    • getB

      public EntityModel getB()
      Getter for the second involved entity.
      Returns:
      entity
    • equals

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