internal void OnFieldRightClick(int i, int j) { //if (!gameTimer.IsRunning()) //{ // gameTimer.StartTime(); //} if (fieldTable[i, j].FType == FieldType.Hidden) { fieldTable[i, j].FType = FieldType.Flag; QuantityBomb--; view.Show(fieldTable, QuantityBomb); } else if (fieldTable[i, j].FType == FieldType.Flag) { fieldTable[i, j].FType = FieldType.Hidden; QuantityBomb++; view.Show(fieldTable, QuantityBomb); } //if (CheckIfWon()) //{ // view.Show(fieldTable, QuantityBomb); // OnWin(); //} }
GameTimer gameTimer;//nie bedzie public Board(SaperView.View v) { this.view = v; this.fieldTable = new Field[boardWidth, boardHeight]; this.tableSize = (boardWidth * boardHeight); this.StartQuantityBombs = 5;//Convert.ToInt32(tableSize * 0.2); this.QuantityBomb = StartQuantityBombs; this.bombTable = new bool[tableSize]; this.gameTimer = new GameTimer(); CreateFields(); view.Init(boardWidth, boardHeight, gameTimer); view.Show(fieldTable, QuantityBomb); }