Changeset 6.1.55 for main.py


Ignore:
Timestamp:
08/21/2016 04:30:58 AM (8 years ago)
Author:
David Owen <dsowen@fugue88.ws>
branch-nick:
state
revision id:
dsowen@fugue88.ws-20160821043058-c4703owypl29jpsv
Message:

Delegated get_mission_failures()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r6.1.54 r6.1.55  
    7171        self.team_failures += 1
    7272
     73    def get_mission_failures(self, team):
     74        failures = 0
     75        for i in team:
     76            if self.role_deck[i] == "SPY":
     77                if not self.players[i].perform_mission():
     78                    failures = failures + 1
     79        return failures
     80
    7381
    7482class AdvanceMission(object):
     
    121129
    122130    def do(self):
    123         failures = 0
    124         for i in self.team:
    125             if self.shared.role_deck[i] == "SPY":
    126                 if not self.shared.players[i].perform_mission():
    127                     failures = failures + 1
    128 
     131        failures = self.shared.get_mission_failures(self.team)
    129132        success = failures < required_failures(self.shared.player_count, self.shared.mission)
    130133
Note: See TracChangeset for help on using the changeset viewer.