Ejemplo n.º 1
0
        public void Init()
        {
            rnd = new Random();

            friendPlayer = new Player(this, PlayerType.IA);
            oppositePlayer = new Player(this, PlayerType.Human);
            friendPlayer.OtherPlayer = oppositePlayer;
            oppositePlayer.OtherPlayer = friendPlayer;

            Choices = new List<Choice[]>();

            Boards = new Board[5];
            for (int i = 0; i < Boards.Length; i++)
            {
                Boards[i] = new Board();
                Boards[i].IdBoard = i;
                Boards[i].Scores = new int[3];

                for (int j = 0; j < 3; j++)
                {
                    Boards[i].Scores[j] = rnd.Next(1, 4);
                }
            }

            //---Test valeur par défaut
            //Boards[0].Scores[0] = 3;
            //Boards[1].Scores[0] = 1;
            //Boards[2].Scores[0] = 3;
            //Boards[3].Scores[0] = 1;
            //Boards[4].Scores[0] = 3;
            //---

            InitCards(ref friendPlayer);
            InitCards(ref oppositePlayer);
        }
Ejemplo n.º 2
0
        public void SetPlayerChoice(Board board, int idIdPlayerCard)
        {
            if (this.ChoiceBoards[board.IdBoard] == null)
                this.ChoiceBoards[board.IdBoard] = new ChoiceBoard();

            this.ChoiceBoards[board.IdBoard].IdBoard = board.IdBoard;
            this.ChoiceBoards[board.IdBoard].IdPlayerCard = IdPlayerCards[idIdPlayerCard];
            this.IdPlayerCards.RemoveAt(idIdPlayerCard);
        }