| 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{ |