Class RotateEvent
java.lang.Object
com.sparshui.common.messages.events.RotateEvent
- All Implemented Interfaces:
Event, Serializable
-
Constructor Summary
ConstructorsConstructorDescriptionRotateEvent(byte[] data) Constructs a new Rotate Event based on a serial representation of a rotate event.RotateEvent(float rotation, Location center, long time) -
Method Summary
-
Constructor Details
-
RotateEvent
public RotateEvent() -
RotateEvent
-
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:EventReturns the integer value of this event type. Event type values are defined in the enumeration com.sparshui.common.messages.events.EventType.java- Specified by:
getEventTypein interfaceEvent- 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 -
toString
-
getRotation
public float getRotation() -
getTime
public long getTime() -
getCenter
-
setCenter
-
getX
public float getX() -
getY
public float getY()
-