MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / save

Function save

code/main/Saving.ts:176–190  ·  view source on GitHub ↗
(game: Game, savingType: MainLoadingType, savingString: string)

Source from the content-addressed store, hash-verified

174 }
175
176 export function save(game: Game, savingType: MainLoadingType, savingString: string): boolean{
177 // Save some special variables by calling the save() methods of various objects
178 game.save(); // Various variables owned by the game object
179 game.getPlayer().save(); // The player
180
181 // Do different things depending on the saving type
182 switch(savingType){
183 case MainLoadingType.LOCAL:
184 return LocalSaving.save(savingString);
185 break;
186 case MainLoadingType.FILE:
187 return false;
188 break;
189 }
190 }
191
192 // Public conversion functions (useful because we sometimes only want to store strings, either locally or online, but in fact we also work with numbers and bools)
193 export function boolToString(b: boolean): string{

Callers

nothing calls this directly

Calls 2

getPlayerMethod · 0.80
saveMethod · 0.45

Tested by

no test coverage detected