Changeset 6.1.33


Ignore:
Timestamp:
08/20/2016 09:09:16 PM (8 years ago)
Author:
David Owen <dsowen@fugue88.ws>
branch-nick:
state
revision id:
dsowen@fugue88.ws-20160820210916-o7q99qssutktstv6
Message:

Moved advance_mission() to state object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r6.1.32 r6.1.33  
    4848        self.shared = shared
    4949
     50    def advance_mission(self):
     51        self.shared.mission += 1
     52        team_size = mission_size(self.shared.player_count, self.shared.mission)
     53        print("Mission {} needs {} members".format(self.shared.mission, team_size))
     54        return AssembleTeam(self.shared, team_size)
     55
    5056
    5157class AssembleTeam(object):
     
    8692    team_failures = 0
    8793    team = None
    88 
    89     def advance_mission():
    90         state.shared.mission += 1
    91         team_size = mission_size(state.shared.player_count, state.shared.mission)
    92         print("Mission {} needs {} members".format(state.shared.mission, team_size))
    93         return AssembleTeam(shared, team_size)
    9494
    9595    def assemble_team():
     
    148148    while True:
    149149        if isinstance(state, AdvanceMission):
    150             state = advance_mission()
     150            state = state.advance_mission()
    151151        elif isinstance(state, AssembleTeam):
    152152            state = assemble_team()
Note: See TracChangeset for help on using the changeset viewer.