Skip to content
Snippets Groups Projects
Select Git revision
  • 83f2716688e11d7985fbd3448c1884ca90391def
  • master default protected
  • 61-upgrade-framework-and-dependencies
  • 42-improve-app-metadata
  • 17-improve-and-complete-offline-words-list-and-tips
  • 6-allow-translate-application
  • 9-improve-documentation
  • Release_1.10.0_44 protected
  • Release_1.9.2_43 protected
  • Release_1.9.1_42 protected
  • Release_1.9.0_41 protected
  • Release_1.8.0_40 protected
  • Release_1.7.0_39 protected
  • Release_1.6.0_38 protected
  • Release_1.5.2_37 protected
  • Release_1.5.1_36 protected
  • Release_1.5.0_35 protected
  • Release_1.4.1_34 protected
  • Release_1.4.0_33 protected
  • Release_1.3.2_32 protected
  • Release_1.3.1_31 protected
  • Release_1.3.0_30 protected
  • Release_1.2.18_29 protected
  • Release_1.2.17_28 protected
  • Release_1.2.16_27 protected
  • Release_1.2.15_26 protected
  • Release_1.2.14_25 protected
27 results

pubspec.lock

Blame
  • game.dart 7.34 KiB
    import 'package:minehunter/config/default_game_settings.dart';
    import 'package:minehunter/models/game/cell.dart';
    import 'package:minehunter/models/settings/settings_game.dart';
    import 'package:minehunter/models/settings/settings_global.dart';
    import 'package:minehunter/models/types.dart';
    import 'package:minehunter/utils/tools.dart';
    
    class Game {
      Game({
        // Settings
        required this.gameSettings,
        required this.globalSettings,
    
        // State
        this.isRunning = false,
        this.isStarted = false,
        this.isFinished = false,
        this.animationInProgress = false,
    
        // Base data
        required this.board,
        required this.sizeHorizontal,
        required this.sizeVertical,
        this.isBoardMined = false,
    
        // Game data
        this.minesCount = 0,
        this.reportMode = false,
        this.gameWin = false,
        this.gameFail = false,
      });
    
      // Settings
      final GameSettings gameSettings;
      final GlobalSettings globalSettings;
    
      // State
      bool isRunning;
      bool isStarted;
      bool isFinished;
      bool animationInProgress;
    
      // Base data
      Board board;
      final int sizeHorizontal;
      final int sizeVertical;
      bool isBoardMined;
    
      // Game data
      int minesCount;
      bool reportMode;
      bool gameWin;
      bool gameFail;
    
      factory Game.createEmpty() {
        return Game(
          // Settings
          gameSettings: GameSettings.createDefault(),
          globalSettings: GlobalSettings.createDefault(),
          // Base data
          board: [],
          sizeHorizontal: 0,
          sizeVertical: 0,
        );
      }
    
      factory Game.createNew({
        GameSettings? gameSettings,
        GlobalSettings? globalSettings,
      }) {