Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): Split Game into GameApi and GameApiExtended interfaces, whi…
…ch are implemented by an object
- Loading branch information
Showing
6 changed files
with
342 additions
and
285 deletions.
There are no files selected for viewing
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,31 @@ | ||
/* | ||
* Contains the extended Game API interface. | ||
* | ||
* Copyright (c) 2018 Joseph R Cowman | ||
* Licensed under MIT License (see https://github.com/regal/regal) | ||
*/ | ||
|
||
import { GameMetadata } from "../config"; | ||
import { GameApi } from "./game-api"; | ||
|
||
/** | ||
* API for interacting with the Regal game. | ||
* | ||
* Contains the standard methods from `GameApi`, as well as additional | ||
* methods for advanced control. | ||
*/ | ||
export interface GameApiExtended extends GameApi { | ||
/** Whether `Game.init` has been called. */ | ||
isInitialized(): boolean; | ||
|
||
/** | ||
* Initializes the game with the given metadata. | ||
* This must be called before any game commands may be executed. | ||
* | ||
* @param metadata The game's configuration metadata. | ||
*/ | ||
init(metadata: GameMetadata): void; | ||
|
||
/** Resets the game's static classes. */ | ||
reset(): void; | ||
} |
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.