コード例 #1
0
        public void PrintBoard()
        {
            BoardConsts consts = new BoardConsts();

            Console.WriteLine();
            for (int i = 0; i < BoardConsts.MAX_LIN; i++)
            {
                for (int j = 0; j < BoardConsts.MAX_COL; j++)
                {
                    if (consts.IsDalrion(MainBoard[i, j]))
                    {
                        ColoredPrint(MainBoard[i, j] + " ", CultColors[ECultures.DALRIONS]);
                    }
                    else if (consts.IsRahkar(MainBoard[i, j]))
                    {
                        ColoredPrint(MainBoard[i, j] + " ", CultColors[ECultures.RAHKARS]);
                    }
                    else
                    {
                        Console.Write(MainBoard[i, j] + " ");
                    }
                    Console.ResetColor();
                }
                PrintSideInfos(i);
            }
            Status = null;
            DrawLine("-", 2 * BoardConsts.MAX_COL);
        }
コード例 #2
0
        public void PrintBoard(Coord cursor)
        {
            BoardConsts consts = new BoardConsts();

            Console.WriteLine();
            for (int i = 0; i < BoardConsts.MAX_LIN; i++)
            {
                for (int j = 0; j < BoardConsts.MAX_COL; j++)
                {
                    if (cursor != null && cursor.Equals(new Coord(i, j)))
                    {
                        Console.BackgroundColor = ConsoleColor.Cyan;
                    }
                    if (consts.IsDalrion(MainBoard[i, j]))
                    {
                        ColoredPrint(MainBoard[i, j] + " ", CultColors[ECultures.DALRIONS]);
                    }
                    else if (consts.IsRahkar(MainBoard[i, j]))
                    {
                        ColoredPrint(MainBoard[i, j] + " ", CultColors[ECultures.RAHKARS]);
                    }
                    else
                    {
                        Console.Write(MainBoard[i, j] + " ");
                    }
                    Console.ResetColor();
                }
                PrintSideInfos(i);
            }
            DrawLine("-", 2 * BoardConsts.MAX_COL);
        }
コード例 #3
0
        public void PrintBoard(string cmd, Coord cursor, Coord selection, List <Coord> avaiableCells)
        {
            BoardConsts consts = new BoardConsts();

            Console.WriteLine();
            for (int i = 0; i < BoardConsts.MAX_LIN; i++)
            {
                for (int j = 0; j < BoardConsts.MAX_COL; j++)
                {
                    if (selection != null && avaiableCells.Contains(new Coord(i, j)))
                    {
                        if (Command.MOVE == cmd)
                        {
                            Console.BackgroundColor = ConsoleColor.DarkGreen;
                        }
                        else if (Command.ATTACK == cmd)
                        {
                            Console.BackgroundColor = ConsoleColor.DarkRed;
                        }
                    }
                    if (cursor != null && cursor.Equals(new Coord(i, j)))
                    {
                        Console.BackgroundColor = ConsoleColor.Cyan;
                    }
                    if (consts.IsDalrion(MainBoard[i, j]))
                    {
                        ColoredPrint(MainBoard[i, j] + " ", CultColors[ECultures.DALRIONS]);
                    }
                    else if (consts.IsRahkar(MainBoard[i, j]))
                    {
                        ColoredPrint(MainBoard[i, j] + " ", CultColors[ECultures.RAHKARS]);
                    }
                    else
                    {
                        Console.Write(MainBoard[i, j] + " ");
                    }
                    Console.ResetColor();
                }
                PrintSideInfos(i);
            }
            DrawLine("-", 2 * BoardConsts.MAX_COL);
        }