Exemple #1
0
 public GameRound(Player player, IEnumerable<Enums.Colors> choices, Enums.Colors answer)
 {
     _player = player;
     _date = DateTime.Now;
     _choices = convertFrom(choices);
     _answer = answer;
 }
Exemple #2
0
        // NOTE: If there ends up being multiple situations a game can be created for/in then move this into a domain entity factory.
        public static GameRound CreateNewGameRoundFor(Player player)
        {
            var colors = Enum.GetValues(typeof(Enums.Colors)).Cast<Enums.Colors>().ToList();
            var choices = new List<Enums.Colors>();
            var answer = getRandomColor(colors);
            choices.Add(answer);

            for(var i = choices.Count(); i < 3; i++)
                choices.Add(getRandomColor(colors));

            return new GameRound(player, choices, answer);
        }
 public GameRoundBuilder(Player player)
 {
     _player = player;
 }