Correct JavaDoc in Mob.

This commit is contained in:
Major-
2014-09-17 03:29:53 +01:00
parent c37401c6bc
commit 4ae9ffa79f
+46 -43
View File
@@ -24,7 +24,7 @@ import org.apollo.game.sync.block.SynchronizationBlock;
import org.apollo.game.sync.block.SynchronizationBlockSet; import org.apollo.game.sync.block.SynchronizationBlockSet;
/** /**
* A {@link Mob} is a living entity in the world, such as a player or NPC. * A {@link Mob} is a living entity in the world, such as a player or npc.
* *
* @author Graham * @author Graham
* @author Major * @author Major
@@ -37,37 +37,7 @@ public abstract class Mob extends Entity {
private transient Action<?> action; private transient Action<?> action;
/** /**
* The position this mob is facing towards. * The attribute map of this mob.
*/
private transient Position facingPosition = position;
/**
* This mob's first movement direction.
*/
private transient Direction firstDirection = Direction.NONE;
/**
* This mob's list of local npcs.
*/
private final transient List<Npc> localNpcs = new ArrayList<>();
/**
* This mob's list of local players.
*/
private final transient List<Player> localPlayers = new ArrayList<>();
/**
* This mob's second movement direction.
*/
private transient Direction secondDirection = Direction.NONE;
/**
* Indicates whether this mob is currently teleporting or not.
*/
private transient boolean teleporting = false;
/**
* The attribute map of this entity.
*/ */
protected final AttributeMap attributes = new AttributeMap(); protected final AttributeMap attributes = new AttributeMap();
@@ -86,6 +56,16 @@ public abstract class Mob extends Entity {
*/ */
protected final Inventory equipment = new Inventory(InventoryConstants.EQUIPMENT_CAPACITY, StackMode.STACK_ALWAYS); protected final Inventory equipment = new Inventory(InventoryConstants.EQUIPMENT_CAPACITY, StackMode.STACK_ALWAYS);
/**
* The position this mob is facing towards.
*/
private transient Position facingPosition = position;
/**
* This mob's first movement direction.
*/
private transient Direction firstDirection = Direction.NONE;
/** /**
* The index of this mob. * The index of this mob.
*/ */
@@ -101,11 +81,31 @@ public abstract class Mob extends Entity {
*/ */
protected final Inventory inventory = new Inventory(InventoryConstants.INVENTORY_CAPACITY); protected final Inventory inventory = new Inventory(InventoryConstants.INVENTORY_CAPACITY);
/**
* This mob's list of local npcs.
*/
private final transient List<Npc> localNpcs = new ArrayList<>();
/**
* This mob's list of local players.
*/
private final transient List<Player> localPlayers = new ArrayList<>();
/**
* This mob's second movement direction.
*/
private transient Direction secondDirection = Direction.NONE;
/** /**
* This mob's skill set. * This mob's skill set.
*/ */
protected final SkillSet skillSet = new SkillSet(); protected final SkillSet skillSet = new SkillSet();
/**
* Indicates whether this mob is currently teleporting or not.
*/
private transient boolean teleporting = false;
/** /**
* This mob's walking queue. * This mob's walking queue.
*/ */
@@ -147,7 +147,7 @@ public abstract class Mob extends Entity {
} }
/** /**
* Gets a shallow copy of the attributes of this entity, as a {@link Map}. * Gets a shallow copy of the attributes of this mob, as a {@link Map}.
* *
* @return The map of attributes. * @return The map of attributes.
*/ */
@@ -287,6 +287,13 @@ public abstract class Mob extends Entity {
return walkingQueue; return walkingQueue;
} }
/**
* Initialises this mob.
*/
private void init() {
World.getWorld().schedule(new SkillNormalizationTask(this));
}
/** /**
* Checks if this mob is active. * Checks if this mob is active.
* *
@@ -441,7 +448,9 @@ public abstract class Mob extends Entity {
} }
stopAction(); stopAction();
} }
return World.getWorld().schedule(this.action = action);
this.action = action;
return World.getWorld().schedule(action);
} }
/** /**
@@ -487,14 +496,8 @@ public abstract class Mob extends Entity {
* @param position The position to face. * @param position The position to face.
*/ */
public final void turnTo(Position position) { public final void turnTo(Position position) {
blockSet.add(SynchronizationBlock.createTurnToPositionBlock(this.facingPosition = position)); this.facingPosition = position;
blockSet.add(SynchronizationBlock.createTurnToPositionBlock(position));
} }
/** }
* Initialises this mob.
*/
private void init() {
World.getWorld().schedule(new SkillNormalizationTask(this));
}
}