1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-08 08:23:11 +00:00

ThreadService implementation

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-27 12:35:05 -03:00
parent 73f51e53c0
commit faec07b8d5
23 changed files with 532 additions and 85 deletions

View File

@@ -29,6 +29,12 @@ import com.l2jserver.service.game.ai.AIScript;
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public class NPC extends Actor {
private NPCState state;
public enum NPCState {
MOVING, ATTACKING;
}
/**
* Creates a new instance
*
@@ -39,6 +45,42 @@ public class NPC extends Actor {
super(templateID);
}
/**
* @return the state
*/
public NPCState getState() {
return state;
}
/**
* @return true if NPC is idle
*/
public boolean isIdle() {
return state == null;
}
/**
* @return true if NPC is idle
*/
public boolean isMoving() {
return state == NPCState.MOVING;
}
/**
* @return true if NPC is idle
*/
public boolean isAttacking() {
return state == NPCState.ATTACKING;
}
/**
* @param state
* the state to set
*/
public void setState(NPCState state) {
this.state = state;
}
@Override
public ActorSex getSex() {
return this.getTemplate().getSex();