# 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:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`RotateEvent()`
`RotateEvent(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

Modifier and Type
Method
Description
`Location`
`getCenter()`
`int`
`getEventType()`
Returns the integer value of this event type.
`float`
`getRotation()`
`long`
`getTime()`
`float`
`getX()`
`float`
`getY()`
`byte[]`
`serialize()`
Constructs the data packet with this event data.
`void`
`setCenter(Location center)`
`String`
`toString()`

### Methods inherited from class Object

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

## 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()