コード例 #1
0
 void RedrawAllPieces()
 {
     //redraw everything
     foreach (Coordinate key in coordinatePieceMap.Keys)
     {
         GamePieceVisual gamePiece = (GamePieceVisual)coordinatePieceMap[key];
         gamePiece.Redraw();
     }
 }
コード例 #2
0
        public void ShowValidMovePieces(ValidMove validMove)
        {
            Coordinate      sourceCoordinate = validMove.Source;
            GamePieceVisual sourcePiece      = coordinatePieceMap[sourceCoordinate] as GamePieceVisual;

            sourcePiece.PieceState  = PieceState.ValidSource;
            sourcePiece.Highlighted = true;
            sourcePiece.Redraw();

            foreach (Coordinate destinationCoordinate in validMove.Destinations)
            {
                GamePieceVisual destinationPiece = coordinatePieceMap[destinationCoordinate] as GamePieceVisual;
                destinationPiece.PieceState = PieceState.ValidDestination;
                destinationPiece.Redraw();
            }
        }