Changeset 6.1.30


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

Copied player_count to shared state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.py

    r6.1.29 r6.1.30  
    3838class Shared(object):
    3939
    40     def __init__(self):
    41         pass
     40    def __init__(self, player_count):
     41        self.player_count = player_count
    4242
    4343
     
    7878            players[i].reveal_spies(spy_nums)
    7979
    80     shared = Shared()
     80    shared = Shared(player_count)
    8181
    8282    wins = 0
     
    8888
    8989    def advance_mission():
    90         team_size = mission_size(player_count, mission)
     90        team_size = mission_size(state.shared.player_count, mission)
    9191        print("Mission {} needs {} members".format(mission, team_size))
    9292        return AssembleTeam(shared, team_size)
     
    105105        print("Team {}: {} for, {} against".format(
    106106            {True: "approved", False: "rejected"}[approved],
    107             approvals, player_count - approvals
     107            approvals, state.shared.player_count - approvals
    108108        ))
    109109
     
    111111            p.observe_team_vote(approved, votes)
    112112
    113         captain = (captain + 1) % player_count
     113        captain = (captain + 1) % state.shared.player_count
    114114
    115115        if approved:
     
    129129                    failures = failures + 1
    130130
    131         success = failures < required_failures(player_count, mission)
     131        success = failures < required_failures(state.shared.player_count, mission)
    132132
    133133        for p in players:
Note: See TracChangeset for help on using the changeset viewer.