コード例 #1
0
        public void AddPiece(int color, string location)
        {
            var intX = RookPiece.ConvertLetterInt(location);
            var intY = Convert.ToInt32(location.Substring(1, 1));

            if (intX == RookPosition.X || intY == RookPosition.Y)
            {
                Board[intX, intY] = color + 1;
            }
        }
コード例 #2
0
        private string GetColFormat(int xPos, int yPos, bool capture)
        {
            var chReturn = "";

            var charCap = capture ? "x" : "-";
            var EndPos  = RookPiece.getCharValue(xPos) + yPos.ToString();

            chReturn = $"R{RookPosition.OrigId}{charCap}{EndPos}";

            return(chReturn);
        }
コード例 #3
0
 public RookMovement(string position)
 {
     RookPosition = new RookPiece(position);
 }