コード例 #1
0
ファイル: BoardField.cs プロジェクト: szymon159/project-game
 public static void SetPieceBoardField(BoardField boardField, bool isSham)
 {
     boardField.Reset();
     boardField.SetBackgroundColor(Colors.Black);
     boardField.SetTextColor(Colors.LightGray);
     if (isSham == true)
     {
         boardField.SetText("SP");
     }
     else
     {
         boardField.SetText("P");
     }
 }
コード例 #2
0
        private void SetBoardFields()
        {
            BoardFields = new BoardField[BoardRows, BoardColumns];
            //fields
            double pointX = 0d;
            double pointY = FieldSize * (BoardRows - 1);

            for (int y = 0; y < BoardRows; y++)
            {
                for (int x = 0; x < BoardColumns; x++)
                {
                    BoardFields[y, x] = new BoardField(canvas, FieldSize, FieldSize, pointX, pointY, Colors.Transparent);
                    pointX           += FieldSize;
                }
                pointX  = 0d;
                pointY -= FieldSize;
                if (pointY < 0)
                {
                    pointY = 0d;
                }
            }
        }
コード例 #3
0
ファイル: BoardField.cs プロジェクト: szymon159/project-game
        public static void SetAgentBoardField(BoardField boardField, int id, bool isRed, bool hasPiece)
        {
            boardField.Reset();
            boardField.label.FontSize = boardField.label.Width / 3;
            if (isRed == true)
            {
                boardField.SetBackgroundColor(Colors.Red);
            }
            else
            {
                boardField.SetBackgroundColor(Colors.Blue);
            }

            if (hasPiece == true)
            {
                boardField.SetText(id.ToString() + "P");
            }
            else
            {
                boardField.SetText(id.ToString());
            }
            boardField.SetTextColor(Colors.Black);
        }