Class PlayableCharacterLock
java.lang.Object
it.polimi.ingsw.server.model.game_logic.PlayableCharacter
it.polimi.ingsw.server.model.game_logic.PlayableCharacterLock
- All Implemented Interfaces:
Playable
-
Field Summary
FieldsFields inherited from class it.polimi.ingsw.server.model.game_logic.PlayableCharacter
characterId, currentCost, effect, initialCost -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanThis method returns true if there are locks available, false otherwiselightify()This method returns the light version of a PlayableCharacterLock, containing all the useful information to be sent over the networkvoidunLock()This method increases the lock countvoiduseLock()This method decreases the lock countMethods 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
addStudent, clearProfessorsToOriginalOwnerMap, containsAllStudents, getInitialStudentsNumberOnCharacter, getProfessorToOriginalOwnerMap, getStudents, putProfessor, removeStudent
-
Field Details
-
availableLocks
private int availableLocks
-
-
Constructor Details
-
PlayableCharacterLock
-
-
Method Details
-
isLockAvailable
public boolean isLockAvailable()This method returns true if there are locks available, false otherwise- Returns:
- true if there are locks available, false otherwise
-
unLock
public void unLock()This method increases the lock count -
useLock
public void useLock()This method decreases the lock count -
lightify
This method returns the light version of a PlayableCharacterLock, containing all the useful information to be sent over the network- Overrides:
lightifyin classPlayableCharacter- Returns:
- a LightPlayableCharacter containing all the useful information to be sent over the network
-