mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 00:38:46 +00:00
Remove duplicate event and decoder.
This commit is contained in:
@@ -1,51 +0,0 @@
|
|||||||
package org.apollo.game.event.impl;
|
|
||||||
|
|
||||||
import org.apollo.game.event.Event;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An event sent when the user moves the camera.
|
|
||||||
*
|
|
||||||
* @author Major
|
|
||||||
*/
|
|
||||||
public class CameraMovementEvent extends Event {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The camera x.
|
|
||||||
*/
|
|
||||||
private final int cameraX;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The camera y.
|
|
||||||
*/
|
|
||||||
private final int cameraY;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new camera movement event.
|
|
||||||
*
|
|
||||||
* @param cameraX The camera x.
|
|
||||||
* @param cameraY The camera y.
|
|
||||||
*/
|
|
||||||
public CameraMovementEvent(int cameraX, int cameraY) {
|
|
||||||
this.cameraX = cameraX;
|
|
||||||
this.cameraY = cameraY;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the camera x.
|
|
||||||
*
|
|
||||||
* @return The camera x.
|
|
||||||
*/
|
|
||||||
public int getCameraX() {
|
|
||||||
return cameraX;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the camera y.
|
|
||||||
*
|
|
||||||
* @return The camera y.
|
|
||||||
*/
|
|
||||||
public int getCameraY() {
|
|
||||||
return cameraY;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package org.apollo.net.release.r317;
|
|
||||||
|
|
||||||
import org.apollo.game.event.impl.CameraMovementEvent;
|
|
||||||
import org.apollo.net.codec.game.DataTransformation;
|
|
||||||
import org.apollo.net.codec.game.DataType;
|
|
||||||
import org.apollo.net.codec.game.GamePacket;
|
|
||||||
import org.apollo.net.codec.game.GamePacketReader;
|
|
||||||
import org.apollo.net.release.EventDecoder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An {@link EventDecoder} for the {@link CameraMovementEvent}.
|
|
||||||
*
|
|
||||||
* @author Toby
|
|
||||||
*/
|
|
||||||
public class CameraMovementEventDecoder extends EventDecoder<CameraMovementEvent> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CameraMovementEvent decode(GamePacket packet) {
|
|
||||||
GamePacketReader reader = new GamePacketReader(packet);
|
|
||||||
int cameraY = (int) reader.getUnsigned(DataType.SHORT);
|
|
||||||
int cameraX = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
|
|
||||||
return new CameraMovementEvent(cameraX, cameraY);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user