GameDifficulty

@interface GameDifficulty : NSObject

GameDifficulty represents a difficulty a specific GameData is to be played at.

  • A display name for the GameDifficulty.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) NSString *name;

    Swift

    var name: String! { get }
  • Enum value representing the difficulty level.

    Declaration

    Objective-C

    @property (readonly, nonatomic) GameDifficultyLevel difficultyLevel;

    Swift

    var difficultyLevel: GameDifficultyLevel { get }
  • The minimum score required to win for this GameDifficulty.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSInteger minimumScore;

    Swift

    var minimumScore: Int { get }
  • Default initializer for GameDifficulty. Converts an NSDictionary representation to a GameDifficulty.

    Declaration

    Objective-C

    + (GameDifficulty *)gameDifficultyFromDictionary:(NSDictionary *)dictionary;

    Swift

    /*not inherited*/ init!(from dictionary: [AnyHashable : Any]!)

    Parameters

    dictionary

    - The dictionary representation of GameDifficulty.

    Return Value

    Instance of GameDifficulty.

  • Converts a GameDifficultyLevel to a string version.

    Declaration

    Objective-C

    + (NSString *)stringFromDifficultyLevel:(GameDifficultyLevel)difficulty;

    Swift

    class func string(from difficulty: GameDifficultyLevel) -> String!

    Parameters

    difficulty

    - The enum GameDifficultyLevel.

    Return Value

    string version of GameDifficultyLevel.

  • Converts a string to enum GameDifficultyLevel.

    Declaration

    Objective-C

    + (GameDifficultyLevel)difficultyLevelFromString:(NSString *)difficulty;

    Swift

    class func difficultyLevel(from difficulty: String!) -> GameDifficultyLevel

    Parameters

    difficulty

    - String value of GameDifficultyLevel.

    Return Value

    GameDifficultyLevel representing the string value.

  • Converts a GameDifficulty to an NSDictionary that can be used for caching or sending to the server.

    Declaration

    Objective-C

    - (NSDictionary *)dictionaryRepresentation;

    Swift

    func dictionaryRepresentation() -> [AnyHashable : Any]!

    Return Value

    dictionary - Dictionary form of a GameDifficulty.