Class PlayableCharacter

java.lang.Object
it.polimi.ingsw.server.model.game_logic.PlayableCharacter
All Implemented Interfaces:
Playable
Direct Known Subclasses:
PlayableCharacterLock, PlayableCharacterProfessor, PlayableCharacterWithStudents

public class PlayableCharacter extends Object implements Playable
  • Field Details

    • characterId

      protected final int characterId
    • initialCost

      protected final int initialCost
    • currentCost

      protected int currentCost
    • effect

      protected final String effect
  • Constructor Details

    • PlayableCharacter

      protected PlayableCharacter(Character character)
  • Method Details

    • createCharacter

      public static PlayableCharacter createCharacter(Character character)
      This method creates the right PlayableCharacter based on the inputted Character and returns it
      Parameters:
      character - represents the character that has to be created
      Returns:
      a PlayableCharacter based on the inputted Character
    • getCurrentCost

      public int getCurrentCost()
      This method returns the current cost to activate the character
      Returns:
      an int representing the current cost of the character
    • increaseCost

      public void increaseCost()
      This method is used to increase the cost of the character after each activation
    • getCharacterId

      public int getCharacterId()
      This method returns the ID of the character
      Returns:
      an int representing the ID of the character
    • lightify

      public LightPlayableCharacter lightify()
      This method creates the light version of the PlayableCharacter containing all the useful information that need to be sent over the network and returns it
      Returns:
      a LightPlayableCharacter representing the light version of the PlayableCharacter