Skip to content
Snippets Groups Projects
Select Git revision
  • 1503e309c3a11948b855a8afeed89552302dcfc5
  • master default protected
  • 42-add-allowed-categories-in-settings-page
  • 44-improve-app-metadata
  • 23-add-tip-response-on-clic-on-button
  • Release_1.11.1_56 protected
  • Release_1.11.0_55 protected
  • Release_1.10.2_54 protected
  • Release_1.10.1_53 protected
  • Release_1.10.0_52 protected
  • Release_1.9.0_51 protected
  • Release_1.8.0_50 protected
  • Release_1.7.0_49 protected
  • Release_1.6.2_48 protected
  • Release_1.6.1_47 protected
  • Release_1.6.0_46 protected
  • Release_1.5.1_45 protected
  • Release_1.5.0_44 protected
  • Release_1.4.1_43 protected
  • Release_1.4.0_42 protected
  • Release_1.3.1_41 protected
  • Release_1.3.0_40 protected
  • Release_1.2.33_39 protected
  • Release_1.2.32_38 protected
  • Release_1.2.31_37 protected
25 results

main.dart

Blame
  • default_game_settings.dart 1.11 KiB
    import 'package:sortgame/data/fetch_data_helper.dart';
    import 'package:sortgame/utils/tools.dart';
    
    class DefaultGameSettings {
      static const List<String> availableParameters = [
        'itemsCount',
        'theme',
      ];
    
      static const int itemsCountValueLow = 5;
      static const int itemsCountValueMedium = 10;
      static const int itemsCountValueHigh = 15;
      static const int itemsCountValueVeryHigh = 20;
    
      static const int defaultItemsCountValue = itemsCountValueMedium;
      static const List<int> allowedItemsCountValues = [
        itemsCountValueLow,
        itemsCountValueMedium,
        itemsCountValueHigh,
        itemsCountValueVeryHigh,
      ];
    
      static const int defaultThemeValue = 0;
    
      static List<int> getAvailableValues(String parameterCode) {
        switch (parameterCode) {
          case 'itemsCount':
            return DefaultGameSettings.allowedItemsCountValues;
        }
    
        switch (parameterCode) {
          case 'theme':
            final int count = FetchDataHelper().getThemes().length;
            return List<int>.generate(count, (i) => i);
        }
    
        printlog('Did not find any available value for game parameter "$parameterCode".');
        return [];
      }
    }