public class LowSkill extends Object
Represents a collection of phases (represented by Phase
), plus intelligent
switching between those phases. An instance of LowSkill comes into
play when HighSkill.pickLowSkill returns this instance as a result.
LowSkill is populated by values contained in an XML. It must possess
a name and an initial phase. Transition between phases is based on temporal
events coming from the server. A low skill can be in one of two states:
either it is finalizing or not. Finalization is triggered by
HighSkill
's execute() method. It is triggered when this instance
of LowSkill has reached the phase with isFinal flag set to true. If
HighSkill
's pickLowSkill method chooses another LowSkill,
a finalization of this LowSkill is executed. The objective of finalization
is to get the player in basic stance.
Every time a new phase is executed, a new target state is calculated by
JointPlacement
. The message sent to the server is generated by
JointPlacement
as well.
Modifier and Type | Field and Description |
---|---|
Phase |
activePhase
Currently active phase of the low skill.
|
private String |
author |
private String |
description |
private String |
extendedFromMove |
private boolean |
finalizing |
String |
initialPhase
Name of the initial phase of this low skill.
|
String |
name
Name of low skill.
|
private double |
nextTimePhaseEnds |
private boolean |
started |
private List<String> |
types |
Constructor and Description |
---|
LowSkill() |
LowSkill(String name,
String initialPhase) |
Modifier and Type | Method and Description |
---|---|
boolean |
canFinalize()
Returns true if finalization of low skill is possible
at the moment, otherwise false.
|
private boolean |
canSkipThisPhase() |
void |
executeFinalisation()
Starts the finalization process of low skill and
final phase is set.
|
String |
getAuthor() |
String |
getDescription() |
String |
getExtendedFromMove() |
List<String> |
getType() |
boolean |
isFinalizing()
Returns true if low skill is finalizing, otherwise false.
|
private boolean |
phaseEnded() |
void |
reset()
Resets all attributes to initial values as in the beginning of low skill.
|
void |
setAuthor(String author) |
void |
setDescription(String description) |
void |
setExtendedFromMove(String extendedFromMove) |
private void |
setNewActivePhase(String phaseName) |
void |
setType(List<String> type) |
private boolean |
shouldSetFalseFlag() |
private boolean |
shouldSetTrueFlag() |
void |
step()
Sets next phase of low skill.
|
String |
toString()
Returns the name of this low skill.
|
String |
toString2()
Returns name, initial phase, types, author, extended from move, description,
active phase, next time phase ends, started and finalizing attributes.
|
public String name
public String initialPhase
private String author
private String extendedFromMove
private String description
public Phase activePhase
private double nextTimePhaseEnds
private boolean started
private boolean finalizing
public void executeFinalisation()
public void reset()
public void step()
private void setNewActivePhase(String phaseName)
private boolean shouldSetTrueFlag()
private boolean canSkipThisPhase()
private boolean shouldSetFalseFlag()
public boolean canFinalize()
private boolean phaseEnded()
public boolean isFinalizing()
public String toString()
public String getAuthor()
public void setAuthor(String author)
public String getExtendedFromMove()
public void setExtendedFromMove(String extendedFromMove)
public String getDescription()
public void setDescription(String description)
public String toString2()