Changeset 6.1.42 for main.py


Ignore:
Timestamp:
08/21/2016 03:58:44 AM (8 years ago)
Author:
David Owen <dsowen@fugue88.ws>
branch-nick:
state
revision id:
dsowen@fugue88.ws-20160821035844-86y40rzdgfku7clz
Message:

Moved losses to shared state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r6.1.41 r6.1.42  
    4545        self.team_failures = 0
    4646        self.wins = 0
     47        self.losses = 0
    4748
    4849
     
    118119    shared = Shared(player_count, players)
    119120
    120     losses = 0
    121 
    122121    def perform_mission():
    123         nonlocal losses
    124 
    125122        failures = 0
    126123        for i in state.team:
     
    139136        else:
    140137            print("Mission had {} failures".format(failures))
    141             losses += 1
     138            state.shared.losses += 1
    142139
    143140        return AdvanceMission(shared)
     
    163160                p.observe_game(True)
    164161            return
    165         elif losses >= 3:
     162        elif shared.losses >= 3:
    166163            print("The Spies won!")
    167164            for p in shared.players:
Note: See TracChangeset for help on using the changeset viewer.