Files
lakebane/src/engine/net/client/handlers/MoveToPointHandler.java
T

53 lines
2.0 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.net.client.handlers;
2023-09-10 14:08:54 -05:00
import engine.Enum;
2022-04-30 09:41:17 -04:00
import engine.exception.MsgSendException;
2023-09-10 14:08:54 -05:00
import engine.gameManager.BuildingManager;
2022-04-30 09:41:17 -04:00
import engine.gameManager.MovementManager;
import engine.net.client.ClientConnection;
import engine.net.client.msg.ClientNetMsg;
import engine.net.client.msg.MoveToPointMsg;
2023-09-10 14:08:54 -05:00
import engine.objects.*;
2022-04-30 09:41:17 -04:00
public class MoveToPointHandler extends AbstractClientMsgHandler {
public MoveToPointHandler() {
super(MoveToPointMsg.class);
}
@Override
protected boolean _handleNetMsg(ClientNetMsg baseMsg,
2023-07-15 09:23:48 -04:00
ClientConnection origin) throws MsgSendException {
2022-04-30 09:41:17 -04:00
MoveToPointMsg msg = (MoveToPointMsg) baseMsg;
PlayerCharacter pc = (origin != null) ? (origin.getPlayerCharacter()) : null;
if (pc == null)
return false;
2023-09-10 15:02:26 -05:00
AbstractWorldObject target = null;
2023-09-10 14:08:54 -05:00
Enum.GameObjectType targetType;
2023-09-10 14:58:56 -05:00
targetType = Enum.GameObjectType.values()[msg.getTargetType()];
switch(targetType){
case Building:
2023-09-10 15:51:25 -05:00
int i = 1;
2023-09-10 14:58:56 -05:00
break;
2023-09-10 15:02:26 -05:00
case NPC:
2023-09-10 15:51:25 -05:00
int j = 1;
2023-09-10 14:58:56 -05:00
break;
}
2022-04-30 09:41:17 -04:00
MovementManager.movement(msg, pc);
return true;
}
}