Class PlayableCharacter
java.lang.Object
it.polimi.ingsw.server.model.game_logic.PlayableCharacter
- All Implemented Interfaces:
Playable
- Direct Known Subclasses:
PlayableCharacterLock,PlayableCharacterProfessor,PlayableCharacterWithStudents
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected intprotected final Stringprotected final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PlayableCharactercreateCharacter(Character character) This method creates the right PlayableCharacter based on the inputted Character and returns itintThis method returns the ID of the characterintThis method returns the current cost to activate the charactervoidThis method is used to increase the cost of the character after each activationlightify()This method creates the light version of the PlayableCharacter containing all the useful information that need to be sent over the network and returns itMethods 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
addStudent, clearProfessorsToOriginalOwnerMap, containsAllStudents, getInitialStudentsNumberOnCharacter, getProfessorToOriginalOwnerMap, getStudents, isLockAvailable, putProfessor, removeStudent, unLock, useLock
-
Field Details
-
characterId
protected final int characterId -
initialCost
protected final int initialCost -
currentCost
protected int currentCost -
effect
-
-
Constructor Details
-
PlayableCharacter
-
-
Method Details
-
createCharacter
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
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
-