public void CreateBlackKnightTest() { var pieceFactory = new BlackPieceFactory(); var blackKnight = pieceFactory.Create("knight"); Assert.IsNotNull(blackKnight); }
public void CreateBlackKingTest() { var pieceFactory = new BlackPieceFactory(); var blackKing = pieceFactory.Create("king"); Assert.IsNotNull(blackKing); }
public void CreateBlackQueenTest() { var pieceFactory = new BlackPieceFactory(); var blackQueen = pieceFactory.Create("queen"); Assert.IsNotNull(blackQueen); }
public void CreateBlackRookTest() { var pieceFactory = new BlackPieceFactory(); var blackRook = pieceFactory.Create("rook"); Assert.IsNotNull(blackRook); }
public void CreateBlackBishopTest() { var pieceFactory = new BlackPieceFactory(); var blackBishop = pieceFactory.Create("bishop"); Assert.IsNotNull(blackBishop); }
public void BlackFactoryNullTest() { var pieceFactory = new BlackPieceFactory(); var nullPiece = pieceFactory.Create("noPiece"); Assert.IsNull(nullPiece); }
public void CreateBlackPawnTest() { var pieceFactory = new BlackPieceFactory(); var blackPawn = pieceFactory.Create("pawn"); Assert.IsNotNull(blackPawn); }
public static void Default(ChessBoard board, List <ChessPiece> whitePieces, List <ChessPiece> blackPieces, out ChessPiece whiteKing, out ChessPiece blackKing) { ChessFactory whiteFactory = new WhitePieceFactory(); ChessFactory blackFactory = new BlackPieceFactory(); for (int i = 0; i < 8; i++) { whitePieces.Add(whiteFactory.CreatePiece <Pawn>(board, i, 1)); } whitePieces.Add(whiteFactory.CreatePiece <Rook>(board, 0, 0)); whitePieces.Add(whiteFactory.CreatePiece <Rook>(board, 7, 0)); whitePieces.Add(whiteFactory.CreatePiece <Knight>(board, 1, 0)); whitePieces.Add(whiteFactory.CreatePiece <Knight>(board, 6, 0)); whitePieces.Add(whiteFactory.CreatePiece <Bishop>(board, 2, 0)); whitePieces.Add(whiteFactory.CreatePiece <Bishop>(board, 5, 0)); whitePieces.Add(whiteFactory.CreatePiece <Queen>(board, 3, 0)); whiteKing = whiteFactory.CreatePiece <King>(board, 4, 0); whitePieces.Add(whiteKing); for (int i = 0; i < 8; i++) { blackPieces.Add(blackFactory.CreatePiece <Pawn>(board, i, 6)); } blackPieces.Add(blackFactory.CreatePiece <Rook>(board, 0, 7)); blackPieces.Add(blackFactory.CreatePiece <Rook>(board, 7, 7)); blackPieces.Add(blackFactory.CreatePiece <Knight>(board, 1, 7)); blackPieces.Add(blackFactory.CreatePiece <Knight>(board, 6, 7)); blackPieces.Add(blackFactory.CreatePiece <Bishop>(board, 2, 7)); blackPieces.Add(blackFactory.CreatePiece <Bishop>(board, 5, 7)); blackPieces.Add(blackFactory.CreatePiece <Queen>(board, 3, 7)); blackKing = blackFactory.CreatePiece <King>(board, 4, 7); blackPieces.Add(blackKing); board.uiPromotion.SetPromotionOptions <Queen>(1, new SpriteHolder { whiteSprite = GameManager.SpriteManager["whiteQueen"], blackSprite = GameManager.SpriteManager["blackQueen"], name = "Queen" }); board.uiPromotion.SetPromotionOptions <Knight>(2, new SpriteHolder { whiteSprite = GameManager.SpriteManager["whiteKnight"], blackSprite = GameManager.SpriteManager["blackKnight"], name = "Knight" }); board.uiPromotion.SetPromotionOptions <Rook>(3, new SpriteHolder { whiteSprite = GameManager.SpriteManager["whiteRook"], blackSprite = GameManager.SpriteManager["blackRook"], name = "Rook" }); board.uiPromotion.SetPromotionOptions <Bishop>(4, new SpriteHolder { whiteSprite = GameManager.SpriteManager["whiteBishop"], blackSprite = GameManager.SpriteManager["blackBishop"], name = "Bishop" }); }
public void Promote <T>() where T : ChessPiece { ChessFactory factory; if (GetTeam() == Team.White) { factory = new WhitePieceFactory(); } else { factory = new BlackPieceFactory(); } promoted = factory.CreatePiece <T>(); promoted.SetPattern(out patterns); this.GetGameObject().GetComponent <SpriteRenderer>().sprite = promoted.SetSprite(); }
public void CreateBlackPieceFactoryTest() { var pieceFactory = new BlackPieceFactory(); Assert.IsNotNull(pieceFactory); }