-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from regal/feat/26-get-post-option
feat(api): Implements Game.postOptionCommand
- Loading branch information
Showing
17 changed files
with
397 additions
and
127 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { InstanceOptions } from "./instance-options"; | ||
export { InstanceOptions, ensureOverridesAllowed } from "./instance-options"; | ||
export { GameOptions, DEFAULT_GAME_OPTIONS, OPTION_KEYS } from "./game-options"; | ||
export { GameMetadata } from "./game-metadata"; | ||
export { GameMetadata, MetadataManager } from "./metadata"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { GameOptions } from "./game-options"; | ||
|
||
/** | ||
* Metadata about the game, such as its title and author. | ||
*/ | ||
export interface GameMetadata { | ||
/** The game's title. */ | ||
name: string; | ||
|
||
/** The game's author. */ | ||
author?: string; | ||
|
||
/** A brief description of the game. */ | ||
headline?: string; | ||
|
||
/** The full description of the game. */ | ||
description?: string; | ||
|
||
/** The URL of the project's homepage. */ | ||
homepage?: string; | ||
|
||
/** The URL of the project's repository */ | ||
repository?: string; | ||
|
||
/** User-defined values for the game's options. */ | ||
options: Partial<GameOptions>; | ||
} | ||
|
||
const accessConfigFile = (): GameMetadata => { | ||
throw new Error("Not yet implemented."); // TODO | ||
}; | ||
|
||
export class MetadataManager { | ||
public static getMetadata(): GameMetadata { | ||
return this._retrievalFunction(); | ||
} | ||
|
||
public static forceConfig(config: GameMetadata): void { | ||
this._retrievalFunction = () => config; | ||
} | ||
|
||
public static reset(): void { | ||
this._retrievalFunction = accessConfigFile; | ||
} | ||
|
||
private static _retrievalFunction = accessConfigFile; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.