Package eu.su.mas.dedale.env.mapElements
Class LockElement
java.lang.Object
eu.su.mas.dedale.env.mapElements.LockElement
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Types of criteria used for lock picking in the environment: lockpicking,strength Not known by the user. -
Constructor Summary
ConstructorDescriptionCreate a lock, closed by defaultLockElement
(Set<dataStructures.tuple.Couple<LockElement.LockType, Integer>> openningCriteria) Create a lock with its opening criteria list. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCriteria
(dataStructures.tuple.Couple<LockElement.LockType, Integer> c) Adding an opening criteria to an existing lockvoid
close()
Close the lockSet
<dataStructures.tuple.Couple<LockElement.LockType, Integer>> boolean
isOpen()
toString()
boolean
tryToOpen
(Map<LockElement.LockType, Integer> expertise)
-
Constructor Details
-
LockElement
public LockElement()Create a lock, closed by default -
LockElement
Create a lock with its opening criteria list. The lock starts as closed.- Parameters:
openningCriteria
- conditions to set for a given lock
-
-
Method Details
-
addCriteria
Adding an opening criteria to an existing lock- Parameters:
c
- criteria to add
-
isOpen
public boolean isOpen()- Returns:
- true is the object is already open
-
tryToOpen
- Parameters:
expertise
- the level of knowledge used to try to open the lock- Returns:
- true is the lock is now open
-
close
public void close()Close the lock -
getOpenningCriteria
- Returns:
- the list of criteria required to open the object
-
toString
-