Example #1
0
    def possible_actions(self,
                         state: State) -> Iterator[Tuple[ResourceNode, int]]:

        for node in self.collectable_resource_nodes(state):
            additional_requirements = self._logic.get_additional_requirements(node)
            if additional_requirements.satisfied(state.resources, self._energy_at_node[node]):
                yield node, self._energy_at_node[node]
            else:
                debug.log_skip_action_missing_requirement(node, self._logic.game,
                                                          self._logic.get_additional_requirements(node))
Example #2
0
    def possible_actions(self, state: State) -> Iterator[ResourceNode]:

        for node in self.uncollected_resource_nodes(state):
            if self._logic.get_additional_requirements(node).satisfied(
                    state.resources, state.resource_database):
                yield node
            else:
                debug.log_skip_action_missing_requirement(
                    node, self._logic.game,
                    self._logic.get_additional_requirements(node))