コード例 #1
0
    private void CreateWonderCard()
    {
        // Data from server
        var wonderCardData = WonderCardsBuilder.CreateHangingGardens("1234");
        //logic card creation
        var wonderCard = CardCreator.Create(wonderCardData);

        // card visualisation
        //CardVisualizationController.Instance.Visualize(wonderCard);

        WonderCardGameSetup.Instance.GlobalSetup(wonderCard);
    }
コード例 #2
0
        public void GameInit(GameSession session)
        {
            // Wonder card
            var wonderCards = new List <WonderCardData>();

            // Common Cards
            var commonCards = new List <CommonCardData>();

            wonderCards.AddRange(new[]
            {
                WonderCardsBuilder.CreateAlexandriaLighthouse(GenerateId()),
                WonderCardsBuilder.CreateArtemisTemple(GenerateId()),
                WonderCardsBuilder.CreateGizaGreatPyramid(GenerateId()),
                WonderCardsBuilder.CreateHalicarnassusMausoleum(GenerateId()),
                WonderCardsBuilder.CreateHangingGardens(GenerateId()),
                WonderCardsBuilder.CreateZeusStatue(GenerateId()),
                (WonderCardData)WonderCardsBuilder.CreateColloss(GenerateId())
            }
                                 );

            var rnd            = new System.Random();
            var rndWonderCards = wonderCards.OrderBy(x => rnd.Next()).ToList();

            foreach (var player in session.Players)
            {
                for (var i = 0; i < CARD_NUMBER; i++)
                {
                    commonCards.Add(CommonCardBuilder.CreateRandomCard(GenerateId()));
                }
            }

            // Seats
            var seats = session.Players.Select(data => data.Id).ToArray();

            GameManager.Instance.OnGameInit(rndWonderCards, commonCards, seats);
        }