Class PlayableCharacterWithStudents
java.lang.Object
it.polimi.ingsw.server.model.game_logic.PlayableCharacter
it.polimi.ingsw.server.model.game_logic.PlayableCharacterWithStudents
- All Implemented Interfaces:
Playable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intFields inherited from class it.polimi.ingsw.server.model.game_logic.PlayableCharacter
characterId, currentCost, effect, initialCost -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStudent(Color student) This method adds a student to the characterbooleancontainsAllStudents(List<Color> students) This method returns true if the inputted students are all contained in the character, false otherwiseintThis method returns the initial number of students on the characterThis method returns the list of the students that are present on the characterlightify()This method returns the light version of the PlayableCharacter, containing all the useful information that need to be sent over the networkbooleanremoveStudent(Color student) This method removes a student from the characterMethods inherited from class it.polimi.ingsw.server.model.game_logic.PlayableCharacter
createCharacter, getCharacterId, getCurrentCost, increaseCostMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface it.polimi.ingsw.server.model.game_logic.Playable
clearProfessorsToOriginalOwnerMap, getProfessorToOriginalOwnerMap, isLockAvailable, putProfessor, unLock, useLock
-
Field Details
-
students
-
initialStudentsNumberOnCharacter
private int initialStudentsNumberOnCharacter
-
-
Constructor Details
-
PlayableCharacterWithStudents
-
-
Method Details
-
containsAllStudents
This method returns true if the inputted students are all contained in the character, false otherwise- Parameters:
students- is the list of students to be checked- Returns:
- true if the inputted students are all contained in the character, false otherwise
-
removeStudent
This method removes a student from the character- Parameters:
student- is the student that will be removed from the character- Returns:
- true if the student was actually present and then removed, false otherwise
-
addStudent
This method adds a student to the character- Parameters:
student- is the student that will be added to the character
-
getInitialStudentsNumberOnCharacter
public int getInitialStudentsNumberOnCharacter()This method returns the initial number of students on the character- Returns:
- an int representing the initial number of students on the character
-
getStudents
This method returns the list of the students that are present on the character- Returns:
- a list of the students that are present on the character
-
lightify
This method returns the light version of the PlayableCharacter, containing all the useful information that need to be sent over the network- Overrides:
lightifyin classPlayableCharacter- Returns:
- a LightPlayableCharacter containing all the useful information that need to be sent over the network
-