/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (SapperGame game = new SapperGame()) { game.Run(); } }
protected Cell(SapperGame sapperGame, Texture2D cellBackGroundTexture, Rectangle position, int boardPositionX, int boardPositionY) { SapperGame = sapperGame; CellBackgroundTexture = cellBackGroundTexture; PositionRectangle = position; BoardPositionX = boardPositionX; BoardPositionY = boardPositionY; }
public override void OnClick() { if (IsFlagOn) { return; } SapperGame.LoseGame(); _isExploded = true; }
public Board(SapperGame sapperGame, int minesNum, int lenght) { _sapperGame = sapperGame; BoardMatrix = new Cell[lenght, lenght]; _minesList = new List <MineCell>(); Rectangle position = new Rectangle(100, 200, 40, 40); for (int i = 0; i < lenght; i++) { for (int j = 0; j < lenght; j++) { BoardMatrix[i, j] = new EmptyCell(_sapperGame, _sapperGame.GameTextures["cleanTexture"], _sapperGame.GameFonts["defaultFont"], position, i, j); position.X += position.Width + 1; } position.X = 100; position.Y += position.Height + 1; } NumOfFlags = minesNum; }
public MineCell(SapperGame game, Texture2D cellBackGroundTexture, Texture2D mineTexture, Rectangle position, int boardPositionX, int boardPositionY) : base(game, cellBackGroundTexture, position, boardPositionX, boardPositionY) { _mineTexture = mineTexture; }
public EmptyCell(SapperGame game, Texture2D cellBackGroundTexture, SpriteFont textFont, Rectangle position, int boardPositionX, int boardPositionY) : base(game, cellBackGroundTexture, position, boardPositionX, boardPositionY) { _textFont = textFont; }