RuneHive-Game
Loading...
Searching...
No Matches
SendCameraMovePosition.java
Go to the documentation of this file.
1package com.runehive.net.packet.out;
2
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.game.world.position.Position;
5import com.runehive.net.packet.OutgoingPacket;
6
8 private final Position position;
9 private final int zPos;
10 private final int constantSpeed;
11 private final int variableSpeed;
12
14 super(166, 7);
15 this.position = position;
16 this.zPos = zPos;
17 this.constantSpeed = constantSpeed;
18 this.variableSpeed = variableSpeed;
19 }
20
21 @Override
22 protected boolean encode(Player player) {
23 final Position base = player.getPosition();
24 final int x = position.getLocalX(base);
25 final int y = position.getLocalY(base);
26 builder.writeByte(x);
27 builder.writeByte(y);
28 builder.writeShort(zPos);
29 builder.writeByte(constantSpeed);
30 builder.writeByte(variableSpeed);
31 return true;
32 }
33}
This class represents a character controlled by a player.
Definition Player.java:125
Represents a single tile on the game world.
Definition Position.java:14
OutgoingPacket(int opcode, int capacity)
SendCameraMovePosition(Position position, int zPos, int constantSpeed, int variableSpeed)