Class IdleTask
java.lang.Object
com.csse3200.game.ai.tasks.DefaultTask
com.csse3200.game.minigames.maze.components.tasks.IdleTask
- All Implemented Interfaces:
PriorityTask
,Task
A Priority task which listens to stun events and forces the AI to sleep for a duration
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.csse3200.game.ai.tasks.Task
Task.Status
-
Field Summary
Fields inherited from class com.csse3200.game.ai.tasks.DefaultTask
owner, status
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the tasks priorityvoid
Sets the idle task to be active (when AI is not moving)void
Sets the idle task to be active (when AI is moving)void
start()
Trigger idle event for animations.Methods inherited from class com.csse3200.game.ai.tasks.DefaultTask
create, getStatus, setOwner, stop, update
-
Constructor Details
-
IdleTask
public IdleTask(int priority) - Parameters:
priority
- Task priority when task is active (0 when not active).
-
-
Method Details
-
setActive
public void setActive()Sets the idle task to be active (when AI is not moving) -
setInactive
public void setInactive()Sets the idle task to be active (when AI is moving) -
start
public void start()Trigger idle event for animations.- Specified by:
start
in interfaceTask
- Overrides:
start
in classDefaultTask
-
getPriority
public int getPriority()Get the tasks priority- Specified by:
getPriority
in interfacePriorityTask
- Returns:
- the tasks priority
-