cleanup (TEST commit 4 after migration)
This commit is contained in:
parent
3b214ddfc3
commit
156ba97505
1 changed files with 21 additions and 60 deletions
|
@ -1,71 +1,32 @@
|
||||||
package common.ai;
|
package common.ai;
|
||||||
|
|
||||||
public abstract class EntityAIBase
|
public abstract class EntityAIBase {
|
||||||
{
|
private int mutex;
|
||||||
/**
|
|
||||||
* A bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields
|
|
||||||
* zero, the two tasks may run concurrently, if not - they must run exclusively from each other.
|
|
||||||
*/
|
|
||||||
private int mutexBits;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether the EntityAIBase should begin execution.
|
|
||||||
*/
|
|
||||||
public abstract boolean shouldExecute();
|
public abstract boolean shouldExecute();
|
||||||
|
|
||||||
/**
|
public boolean continueExecuting() {
|
||||||
* Returns whether an in-progress EntityAIBase should continue executing
|
|
||||||
*/
|
|
||||||
public boolean continueExecuting()
|
|
||||||
{
|
|
||||||
return this.shouldExecute();
|
return this.shouldExecute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public boolean isInterruptible() {
|
||||||
* Determine if this AI Task is interruptible by a higher (= lower value) priority task. All vanilla AITask have
|
|
||||||
* this value set to true.
|
|
||||||
*/
|
|
||||||
public boolean isInterruptible()
|
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void startExecuting() {
|
||||||
* Execute a one shot task or start executing a continuous task
|
|
||||||
*/
|
|
||||||
public void startExecuting()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void resetTask() {
|
||||||
* Resets the task
|
|
||||||
*/
|
|
||||||
public void resetTask()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void updateTask() {
|
||||||
* Updates the task
|
|
||||||
*/
|
|
||||||
public void updateTask()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setMutexBits(int bits) {
|
||||||
* Sets a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it
|
this.mutex = bits;
|
||||||
* yields zero, the two tasks may run concurrently, if not - they must run exclusively from each other.
|
|
||||||
*/
|
|
||||||
public void setMutexBits(int mutexBitsIn)
|
|
||||||
{
|
|
||||||
this.mutexBits = mutexBitsIn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public int getMutexBits() {
|
||||||
* Get a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields
|
return this.mutex;
|
||||||
* zero, the two tasks may run concurrently, if not - they must run exclusively from each other.
|
|
||||||
*/
|
|
||||||
public int getMutexBits()
|
|
||||||
{
|
|
||||||
return this.mutexBits;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue