core.game

## Class Event

- java.lang.Object
- - core.game.Event

- All Implemented Interfaces:
    java.lang.Comparable<Event>

      public class Event
      extends java.lang.Object
      implements java.lang.Comparable<Event>

  Created by diego on 24/03/14.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `activeSpriteId` Sprite ID of the object that triggers the event (either the avatar, or something created by the avatar).
    `int` | `activeTypeId` Type id of the object that triggers the event (either the avatar, or something created by the avatar).
    `boolean` | `fromAvatar` True if the avatar triggered the event, false otherwise (example: something that is thrown by the avatar hits a sprite).
    `int` | `gameStep` Game step when the event happened.
    `int` | `passiveSpriteId` Sprite ID of the object that received the event (what did the avatar, or something created by the avatar, collided with?).
    `int` | `passiveTypeId` Type id of the object that received the event (what did the avatar, or something created by the avatar, collided with?).
    `Vector2d` | `position` Position where the event took place.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Event(int gameStep, boolean fromAvatar, int activeTypeId, int passiveTypeId, int activeSpriteId, int passiveSpriteId, Vector2d position)` Constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Event o)`
    `Event` | `copy()` Creates a copy of this event.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### gameStep

          public int gameStep

      Game step when the event happened.

    - #### fromAvatar

          public boolean fromAvatar

      True if the avatar triggered the event, false otherwise (example: something that is thrown by the avatar hits a sprite).

    - #### activeTypeId

          public int activeTypeId

      Type id of the object that triggers the event (either the avatar, or something created by the avatar).

    - #### passiveTypeId

          public int passiveTypeId

      Type id of the object that received the event (what did the avatar, or something created by the avatar, collided with?).

    - #### activeSpriteId

          public int activeSpriteId

      Sprite ID of the object that triggers the event (either the avatar, or something created by the avatar).

    - #### passiveSpriteId

          public int passiveSpriteId

      Sprite ID of the object that received the event (what did the avatar, or something created by the avatar, collided with?).

    - #### position

          public Vector2d position

      Position where the event took place.

  - ### Constructor Detail

    - #### Event

          public Event(int gameStep,
               boolean fromAvatar,
               int activeTypeId,
               int passiveTypeId,
               int activeSpriteId,
               int passiveSpriteId,
               Vector2d position)

      Constructor
      Parameters:
        `gameStep` - when the event happened.
        `fromAvatar` - did the avatar trigger the event (true), or something created by him (false)?
        `activeTypeId` - type of the sprite (avatar or from avatar).
        `passiveTypeId` - type of the sprite that collided with activeTypeId.
        `activeSpriteId` - sprite ID of the avatar (or something created by the avatar).
        `passiveSpriteId` - sprite ID of the other object.
        `position` - where did the event take place.

  - ### Method Detail

    - #### copy

          public Event copy()

      Creates a copy of this event.
      Returns:
        the copy.

    - #### compareTo

          public int compareTo(Event o)

      Specified by:
        `compareTo` in interface `java.lang.Comparable<Event>`