Changeset 6.1.32


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

Moved mission to shared state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r6.1.31 r6.1.32  
    4040    def __init__(self, player_count):
    4141        self.player_count = player_count
     42        self.mission = 0
    4243
    4344
     
    8485    captain = 0
    8586    team_failures = 0
    86     mission = 0
    8787    team = None
    8888
    8989    def advance_mission():
    90         nonlocal mission
    91         mission += 1
    92         team_size = mission_size(state.shared.player_count, mission)
    93         print("Mission {} needs {} members".format(mission, team_size))
     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))
    9493        return AssembleTeam(shared, team_size)
    9594
     
    123122
    124123    def perform_mission():
    125         nonlocal wins, losses, mission
     124        nonlocal wins, losses
    126125
    127126        failures = 0
     
    131130                    failures = failures + 1
    132131
    133         success = failures < required_failures(state.shared.player_count, mission)
     132        success = failures < required_failures(state.shared.player_count, state.shared.mission)
    134133
    135134        for p in players:
Note: See TracChangeset for help on using the changeset viewer.