Skip to content
Snippets Groups Projects
Select Git revision
  • 362e9a7e662d3747c6cdcb33db8a472df6674e5b
  • master default protected
  • 49-upgrade-framework-and-dependencies
  • 32-improve-app-metadata
  • Release_0.9.0_43 protected
  • Release_0.8.2_42 protected
  • Release_0.8.1_41 protected
  • Release_0.8.0_40 protected
  • Release_0.7.0_39 protected
  • Release_0.6.0_38 protected
  • Release_0.5.0_37 protected
  • Release_0.4.2_36 protected
  • Release_0.4.1_35 protected
  • Release_0.4.0_34 protected
  • Release_0.3.1_33 protected
  • Release_0.3.0_32 protected
  • Release_0.2.1_31 protected
  • Release_0.2.0_30 protected
  • Release_0.1.2_29 protected
  • Release_0.1.1_28 protected
  • Release_0.1.0_27 protected
  • Release_0.0.26_26 protected
  • Release_0.0.25_25 protected
  • Release_0.0.24_24 protected
24 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,
      }) {