Changeset 6.1.41 for main.py


Ignore:
Timestamp:
08/21/2016 03:53:45 AM (8 years ago)
Author:
David Owen <dsowen@fugue88.ws>
branch-nick:
state
revision id:
dsowen@fugue88.ws-20160821035345-phthq2jk8uhgfrbr
Message:

Moved wins to shared state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r6.1.40 r6.1.41  
    4444        self.captain = 0
    4545        self.team_failures = 0
     46        self.wins = 0
    4647
    4748
     
    117118    shared = Shared(player_count, players)
    118119
    119     wins = 0
    120120    losses = 0
    121121
    122122    def perform_mission():
    123         nonlocal wins, losses
     123        nonlocal losses
    124124
    125125        failures = 0
     
    136136        if success:
    137137            print("Mission succeeded")
    138             wins += 1
     138            state.shared.wins += 1
    139139        else:
    140140            print("Mission had {} failures".format(failures))
     
    158158                p.observe_game(False)
    159159            return
    160         elif wins >= 3:
     160        elif shared.wins >= 3:
    161161            print("The Resistance won!")
    162162            for p in shared.players:
Note: See TracChangeset for help on using the changeset viewer.