Class RotateEvent

java.lang.Object
com.sparshui.common.messages.events.RotateEvent
All Implemented Interfaces:
Event, Serializable

public class RotateEvent extends Object implements Event
See Also:
  • Constructor Details

    • RotateEvent

      public RotateEvent()
    • RotateEvent

      public RotateEvent(float rotation, Location center, long time)
    • RotateEvent

      public RotateEvent(byte[] data)
      Constructs a new Rotate Event based on a serial representation of a rotate event. - 4 bytes : rotation - 4 bytes : center - x coordinate - 4 bytes : center - y coordinate - 12 bytes total
      Parameters:
      data -
  • Method Details

    • getEventType

      public int getEventType()
      Description copied from interface: Event
      Returns the integer value of this event type. Event type values are defined in the enumeration com.sparshui.common.messages.events.EventType.java
      Specified by:
      getEventType in interface Event
      Returns:
      The event type
    • serialize

      public byte[] serialize()
      Constructs the data packet with this event data. Message format for this event: - 4 bytes : event type - 4 bytes : rotation - 4 bytes : center - x coordinate - 4 bytes : center - y coordinate - 16 bytes total
      Specified by:
      serialize in interface Event
      Returns:
      serialized data
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRotation

      public float getRotation()
    • getTime

      public long getTime()
    • getCenter

      public Location getCenter()
    • setCenter

      public void setCenter(Location center)
    • getX

      public float getX()
    • getY

      public float getY()