Esempio n. 1
0
        public void SpawnChessPiece(int x, int y, ChessPieceColor color, Type _CPClass)
        {
            Object  newObject = Activator.CreateInstance(_CPClass, new Object[] { x, y, color });
            CPClass newClass  = (CPClass)newObject;

            chessPieces.Add(newClass);
            chessBoardNodeArray[x, y].ChangePiece(newClass);
        }
Esempio n. 2
0
        public List <AvailableMove> GetMoves() //Show valid selected piece moves
        {
            List <AvailableMove> newMoves = new List <AvailableMove>();

            CPClass chessPiece = chessBoardNodeArray[selectedX, selectedY].chessPiece;

            chessPiece.GetAvailableMoves(chessBoardNodeArray, out newMoves);

            return(newMoves);
        }