コード例 #1
0
ファイル: Player.cs プロジェクト: zzzbatmand/LudoManiaz
        private int startLocation   = 0;                    // Start location for a new pawn.

        public Player(Program.Colors colorz)
        {
            int player = (int)colorz;

            color = colorz;

            for (int i = 0; i < pawnLocations.GetLength(0); i++)
            {
                pawnLocations[i, 0] = board.home[player, i, 0];
                pawnLocations[i, 1] = board.home[player, i, 1];
            }

            //pawnLocations = board.home.GetValue(player)
        }
コード例 #2
0
        // Test functions, move these to other files.
        // This sets a specific color at a specefic position in the possible path... Just try it.
        public void setPlayPos(Program.Colors ePlayer, int pos)
        {
            // Just to make sure it doesn't crash if the value is above 51
            while (pos > 51)
            {
                pos -= 52;
            }


            int  player = (int)ePlayer; // Convert Program.Colors to int.
            int  x = path[pos, 0], y = path[pos, 1];
            char color = 'w';

            // Set the item, so it can be removed in the switch.
            map[x, y] = 'O';
            switch (player)
            {
            case 0:
                color = 'r';
                break;

            case 1:
                color = 'g';
                break;

            case 2:
                color = 'y';
                break;

            case 3:
                color = 'b';
                break;

            case 4:
                color     = 'w';
                map[x, y] = ' ';
                break;
            }

            // Set the pre defined color.
            colors[x, y] = color;
            occupiedSpaces.Add(pos);
        }