public class FakeHighSkill extends HighSkill
HighSkill.HighSkillState
Modifier and Type | Field and Description |
---|---|
boolean |
shouldThrowException |
LowSkill |
skillToChoose |
currentSkill, name, nextSkill, state
Constructor and Description |
---|
FakeHighSkill() |
Modifier and Type | Method and Description |
---|---|
void |
checkProgress()
Called on every single step of the high skill.
|
LowSkill |
pickLowSkill()
Called everytime the current low skill enters a phase that be can be finalized
(so that it's possible to safely switch to a new low skill, see TODO: wiki link)
|
execute, getCurrentSkill, isEnded, setCurrentSkill, toString
public boolean shouldThrowException
public LowSkill skillToChoose
public void checkProgress() throws Exception
HighSkill
Called on every single step of the high skill. That means every tick.
Should throw an exception if the agent is found to be in an unexpected state, e.g. fallen on ground during walking.
Causes this skill's execution to be immediately terminated.
TODO: does it work? should it work this way? currently, falling is handled by the pickLowSkill methods in our high skillscheckProgress
in interface IHighSkill
checkProgress
in class HighSkill
Exception
- means that the high skill needs to be interrupted without regard
to safe finalization of the current low skillpublic LowSkill pickLowSkill()
HighSkill
Called everytime the current low skill enters a phase that be can be finalized (so that it's possible to safely switch to a new low skill, see TODO: wiki link)
Returns the next skill that needs to be executed in order to fulfill goals of this HighSkill.
If the returned skill is the same as the current skill, it will continue normally.
If a different low skill or null is returned, the current low skill will be finalized. Once that finalization has been succesfully completed, the returned low skill will be set as the new executed low skill, or, if null was returned, the high skill will end.
pickLowSkill
in interface IHighSkill
pickLowSkill
in class HighSkill