Skip to content
Snippets Groups Projects
Select Git revision
  • 1207bd25ecd00d3cf516e9a2088891856a151dc6
  • master default protected
  • 60-display-last-tracks-and-some-dump-metadata
  • 58-create-api-for-main-routes
  • 40-add-more-default-playlists-in-quick-create-feature
  • 37-batch-update-recently-played-tracks
  • 11-improve-new-playlist-name-and-description
  • 15-add-a-play-now-button-on-created-playlist-message
  • 20-rename-playlist-with-artists-names
  • 30-save-spotify-personal-token-for-external-use
10 results

PlaylistController.php

Blame
  • default_game_settings.dart 1.52 KiB
    import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
    
    class DefaultGameSettings {
      // available game parameters codes
      static const String parameterCodeGameMode = 'gameMode';
      static const String parameterCodeSize = 'size';
      static const List<String> availableParameters = [
        parameterCodeGameMode,
        parameterCodeSize,
      ];
    
      // game mode: available values
      static const String gameModeHumanVsHuman = 'human-vs-human';
      static const String gameModeHumanVsRobot = 'human-vs-robot';
      static const String gameModeRobotVsHuman = 'robot-vs-human';
      static const String gameModeRobotVsRobot = 'robot-vs-robot';
      static const List<String> allowedGameModeValues = [
        gameModeHumanVsHuman,
        gameModeHumanVsRobot,
        gameModeRobotVsHuman,
        gameModeRobotVsRobot,
      ];
      // game mode: default value
      static const String defaultGameModeValue = gameModeHumanVsHuman;
    
      // size: available values
      static const String sizeValueMedium = '7x6';
      static const List<String> allowedSizeValues = [
        sizeValueMedium,
      ];
      // size: default value
      static const String defaultSizeValue = sizeValueMedium;
    
      // available values from parameter code
      static List<String> getAvailableValues(String parameterCode) {
        switch (parameterCode) {
          case parameterCodeGameMode:
            return DefaultGameSettings.allowedGameModeValues;
          case parameterCodeSize:
            return DefaultGameSettings.allowedSizeValues;
        }
    
        printlog('Did not find any available value for game parameter "$parameterCode".');
        return [];
      }
    }