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

public class PlayableCharacterWithStudents extends PlayableCharacter
  • Field Details

    • students

      private List<Color> students
    • initialStudentsNumberOnCharacter

      private int initialStudentsNumberOnCharacter
  • Constructor Details

    • PlayableCharacterWithStudents

      protected PlayableCharacterWithStudents(Character character)
  • Method Details

    • containsAllStudents

      public boolean containsAllStudents(List<Color> students)
      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

      public boolean removeStudent(Color student)
      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

      public void addStudent(Color student)
      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

      public List<Color> 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

      public LightPlayableCharacter lightify()
      This method returns the light version of the PlayableCharacter, containing all the useful information that need to be sent over the network
      Overrides:
      lightify in class PlayableCharacter
      Returns:
      a LightPlayableCharacter containing all the useful information that need to be sent over the network