Пример #1
0
        public void StartGame(GameType gt)
        {
            for (int i = 0; i < map.GetLength(0); i++)
            {
                for (int j = 0; j < map.GetLength(1); j++)
                {
                    map[i, j] = null;
                }
            }
            type = gt;

            if (type == GameType.Player1)
                turns[1] = new AITurn(map.GetLength(0), map.GetLength(1), this);
            else
                turns[1] = new Turn2(map.GetLength(0), map.GetLength(1));

            turns[1].LoadTexture(content);

            deploy = 6;
            currState = GameState.GameRunning;

            SetCenter(center);
            LoadDecks();

            foreach (Turn t in turns)
            {
                t.ClearHand();
                t.ShuffleDeck();

                for (int i = 0; i < 5; i++)
                {
                    t.AddToHand();
                }
            }

            Random rand = new Random();
            activeTurn = turns[rand.Next(turns.Count -1)];

            moveStack.Clear();
        }
Пример #2
0
        public MapView()
            : base()
        {
            // This would be where to create the map of whatever size. We are starting with 5 by 5, but the gate is out of that.
            // So we need an extra one on both sides. The other extras will just be marked as filled by something.
            map = new CardClass[7,7];

            turns[0] = new Turn1(map.GetLength(0), map.GetLength(1));
            if (type == GameType.Player1)
                turns[1] = new AITurn(map.GetLength(0), map.GetLength(1), this);
            else
                turns[1] = new Turn2(map.GetLength(0), map.GetLength(1));

            cardTypes = new List<CardType>();
            moveStack = new Stack<MoveList>();

            activeTurn = turns[0];
            winner = 0;
        }