public static Texture2D GetTextureForPiece(kSides side, kPieceTypes pieceType) { string fileName = string.Format("Resources\\Pieces\\old_{0}_{1}_25x25.png", kPieceColourDict[side], kPieceStrDict[pieceType]); Texture2D texture = Texture2D.FromStream(Game1.Instance.GraphicsDevice, File.OpenRead(fileName)); return(texture); }
public ChessPiece(kSides side, kPieceTypes pieceType, ChessPosition position) { this.side = side; this.pieceType = pieceType; this.isActive = true; this.isSelected = false; this.position = position; this.initTexture(); }
public static Texture2D GetTextureForPiece(kSides side, kPieceTypes pieceType) { string fileName = string.Format("Resources\\Pieces\\old_{0}_{1}_25x25.png", kPieceColourDict[side], kPieceStrDict[pieceType]); Texture2D texture = Texture2D.FromStream(Game1.Instance.GraphicsDevice, File.OpenRead(fileName)); return texture; }