Fix exploration member selection and automatic reward collection
This commit is contained in:
@@ -33,12 +33,12 @@ def prepare_exploration_rows(engine):
|
||||
return prepared
|
||||
|
||||
|
||||
def prepare_exploration_members(engine, team_id):
|
||||
def prepare_exploration_members(engine, team_id, policy=None):
|
||||
"""Worker candidate DTOs include protected monsters with exclusion reasons."""
|
||||
if engine.snapshot is None:
|
||||
return []
|
||||
return engine.explore_planner.member_options(engine.snapshot, int(team_id),
|
||||
engine.explore_policy, engine.policy)
|
||||
engine.explore_policy if policy is None else policy, engine.policy)
|
||||
|
||||
|
||||
class ExplorationTable(W.QTableWidget):
|
||||
@@ -263,6 +263,10 @@ class ExplorationPages:
|
||||
self._exploration_drafts.pop(key, None)
|
||||
self._exploration_policy.teams[key] = rule
|
||||
self._save_exploration_policy()
|
||||
self._exploration_member_options.pop(key, None)
|
||||
self._exploration_member_queue = [queued for queued in self._exploration_member_queue if queued != key]
|
||||
self._exploration_member_queue.insert(0, key)
|
||||
self._request_next_exploration_members()
|
||||
elif field == "monster":
|
||||
position, mid = value
|
||||
if not 0 <= position < 3:
|
||||
@@ -384,11 +388,14 @@ class ExplorationPages:
|
||||
return
|
||||
self._exploration_member_busy = True
|
||||
generation = self._exploration_generation
|
||||
policy = self.read_explore_policy()
|
||||
area = policy.teams.get(key, ExploreTeamRule()).area
|
||||
self.submit("exploration_members:" + key,
|
||||
lambda key=key: (generation, key, prepare_exploration_members(self.engine, key)))
|
||||
lambda key=key: (generation, key, area, prepare_exploration_members(self.engine, key, policy)))
|
||||
|
||||
def accept_exploration_members(self, generation, key, options):
|
||||
if generation == self._exploration_generation:
|
||||
def accept_exploration_members(self, generation, key, area, options):
|
||||
current_area = self._exploration_policy.teams.get(key, ExploreTeamRule()).area
|
||||
if generation == self._exploration_generation and area == current_area:
|
||||
self._exploration_member_options[key] = options
|
||||
self.render_exploration(self._exploration_rows)
|
||||
self._exploration_complete_member_request()
|
||||
|
||||
Reference in New Issue
Block a user