Package behaviors
Class Guessing
java.lang.Object
behaviors.Guessing
- All Implemented Interfaces:
lejos.robotics.subsumption.Behavior
Waits for the user to guess, when the guess switches to drawing and draws either hangman or (a) character(s) based on the guess.
- Since:
- 2023
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Guessing
public Guessing()Guessing constructor assigns surpressed to false.
-
-
Method Details
-
action
public void action()Action method makes sure surpessed is false before starting and then sends a state packet to the server. Then it gets a packet from the server and gets the data, the data when type is guess will be the guess.- Specified by:
action
in interfacelejos.robotics.subsumption.Behavior
-
suppress
public void suppress()Uses surpress to exit the loop at times.- Specified by:
suppress
in interfacelejos.robotics.subsumption.Behavior
-
takeControl
public boolean takeControl()Takes control when the state is equal to the GUESSING state.- Specified by:
takeControl
in interfacelejos.robotics.subsumption.Behavior
- Returns:
- boolean
-