This repository has been archived by the owner on Oct 25, 2022. It is now read-only.
forked from cameroncondry/cbc-kitten-scientists
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dev): Load savegame in dev container
- Loading branch information
1 parent
3701d16
commit 9c07268
Showing
5 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,27 @@ | ||
import { GamePage } from "../types"; | ||
|
||
export class SavegameLoader { | ||
private readonly _gamePage: GamePage; | ||
|
||
constructor(gamePage: GamePage) { | ||
this._gamePage = gamePage; | ||
} | ||
|
||
/** | ||
* Conveniently wraps the savegame loading process in an async construct. | ||
* @param data The savegame data to load. | ||
* @returns Nothing | ||
*/ | ||
load(data: string): Promise<void> { | ||
return new Promise((resolve, reject) => { | ||
this._gamePage.saveImportDropboxText(data, error => { | ||
if (error) { | ||
reject(error); | ||
return; | ||
} | ||
|
||
resolve(); | ||
}); | ||
}); | ||
} | ||
} |
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