Beispiel #1
0
 public GameData(GameDto dto)
 {
     Players = dto.PlayersData.Select(x => new Player(new PlayerData(x), null)).ToList();
     CardHolder = new CardHolder(dto.CardHolder);
     GemHolder = new GemHolder(dto.GemHolder);
     Customers = dto.Customers.Select(x => new Customer(x)).ToList();
     PlayersCircularManager = new PlayersCircularManager(Players);
 }
 private void Print(GameDto gameDto)
 {
     Print(gameDto.GemHolder);
     Console.WriteLine("1 Level Cards");
     Print(gameDto.CardHolder.ActiveCards.Cards1Level);
     Console.WriteLine("2 Level Cards");
     Print(gameDto.CardHolder.ActiveCards.Cards2Level);
     Console.WriteLine("3 Level Cards");
     Print(gameDto.CardHolder.ActiveCards.Cards3Level);
 }
 public PlayerMainAction DoMainAction(GameDto getGameDto)
 {
     return new PlayerMainAction
     {
         MainTurnAction = MainTurnAction.Take3DifferentGems,
         Parameters = new Take3DifferentGemsParameters
         {
             Gems = new [] {Gem.Blue, Gem.Green, Gem.White}
         }
     };
 }
Beispiel #4
0
        public static GameDto GetGameDto(this GameData game)
        {
            var gameDto = new GameDto
            {
                PlayersData = game.Players.Select(x => x.PlayerData.GetPlayerDataDto()).ToList(),
                Customers = game.Customers.Select(x => x.GetCustomerDto()).ToList(),
                GemHolder = game.GemHolder.GetGemRepositoryDto(),
                CardHolder = game.CardHolder.GetCardHolderDto(),
                //GameRoundManager = game.GameRoundManager.GetGameRoundManagerDto()
            };

            return gameDto;
        }
        public PlayerMainAction DoMainAction(GameDto gameDto)
        {
            Print(gameDto);

            var result = Console.ReadKey();

            return new PlayerMainAction
            {
                MainTurnAction = MainTurnAction.Take3DifferentGems,
                Parameters = new Take3DifferentGemsParameters
                {
                    Gems = new[] { Gem.Blue, Gem.Green, Gem.Red }
                }
            };
        }