Esempio n. 1
0
 def check(
     self,
     caller: AbstractSkillWrapper,
     reference_graph: NameIndexedGraph,
     context=None,
 ) -> bool:
     return reference_graph.get_element(self._checking_element_name).is_usable()
Esempio n. 2
0
 def check(
     self,
     caller: AbstractSkillWrapper,
     reference_graph: NameIndexedGraph,
     context=None,
 ) -> bool:
     if not reference_graph.get_element(self._state_element_name).is_usable():
         return True
     return False
Esempio n. 3
0
 def check(
     self,
     caller: AbstractSkillWrapper,
     reference_graph: NameIndexedGraph,
     context=None,
 ) -> bool:
     timer: AbstractSkillWrapper = reference_graph.get_element(self._timer_element)
     if not timer.is_not_active():
         if not timer.is_time_left(self.time, self.direction):
             if not timer.is_time_left(caller.skill.cooltime, 1):
                 return False
     return True
Esempio n. 4
0
 def check(
     self,
     caller: AbstractSkillWrapper,
     reference_graph: NameIndexedGraph,
     context=None,
 ) -> bool:
     return self._check_function(
         caller,
         *[
             reference_graph.get_element(name)
             for name in self._checking_element_names
         ],
     )
Esempio n. 5
0
 def get_related_elements(
         self, reference_graph: NameIndexedGraph) -> List[GraphElement]:
     return [reference_graph.get_element(self._state_element_name)]
Esempio n. 6
0
 def get_related_elements(self, reference_graph: NameIndexedGraph):
     return [reference_graph.get_element(self.target_element)]