Esempio n. 1
0
        public void SetRules(IMafiaRules rules)
        {
            _rules = rules;
            foreach (var defName in _rules.DefaultTeams)
            {
                _createdTeams.Add(defName.ToLower(), _teamFactory.Create(defName));
            }

            foreach (var teamDescription in _rules.CustomTeams)
            {
                _createdTeams.Add(teamDescription.TeamName.ToLower(),
                                  _teamFactory.Create(
                                      teamDescription.TeamName,
                                      teamDescription.EffectName,
                                      teamDescription.IsBlockingEffect));
            }
        }
 public ClassicRulesValidator(IMafiaRules rules)
 {
     _rules = rules;
 }
Esempio n. 3
0
 public MafiaGame(IList <ITeam> teams, IMafiaRules rules)
 {
     Players = new PlayerCollection(teams.SelectMany(i => i.Participants));
     Teams   = new TeamCollection(teams);
     Rules   = rules;
 }