public void Load() { // BEGIN loading_test // Try to load the game from a file called "SaveGame.json" SavingService.LoadGame("SaveGame.json"); // END loading_test }
public void Save() { // BEGIN saving_test // Save the game to a file called "SaveGame.json" SavingService.SaveGame("SaveGame.json"); // END saving_test }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject == player) { TimeLapseController.instance.TimeLapseCharge += 4; Destroy(this.gameObject); SavingService.SaveGame("SaveGame.json"); } }
static void Main(string[] args) { try { if (args.Length == 0) { throw new WrongCommandLineArguments("Arguments are not specified."); } switch (args[0].Substring(1)) { case "s": if (args.Length < 2) { throw new WrongCommandLineArguments("Folder path is not specified."); } EstimatingService.EstimateWorkToSave(@args[1]); if (args.Length < 3) { SavingService.Save(@args[1], null); } else { SavingService.Save(@args[1], @args[2]); } break; case "u": if (args.Length < 2) { throw new WrongCommandLineArguments("File path is not specified."); } EstimatingService.EstimateWorkToUnpack(@args[1]); if (args.Length < 3) { UnpackingService.Unpack(@args[1], null); } else { UnpackingService.Unpack(@args[1], @args[2]); } break; default: throw new WrongCommandLineArguments("Arguments are not recognized."); } } catch (WrongCommandLineArguments e) { InfoService.ShowErrorMessage(e.Message); InfoService.ShowHelpMessage(); } catch (Exception e) { InfoService.ShowErrorMessage(e.Message); } }
public AddInterestCommand(SavingService savingService) { this.savingService = savingService; }
public string DispatchCommand(string[] commandParameters) { string commandName = commandParameters[0]; commandParameters = commandParameters.Skip(1).ToArray(); string result = string.Empty; SavingService savingService = new SavingService(); CheckingService checkingService = new CheckingService(); UserService userService = new UserService(); switch (commandName) { case "Exit": ExitCommand exit = new ExitCommand(); result = exit.Execute(); break; case "Deposit": DepositCommand deposit = new DepositCommand(savingService); result = deposit.Execute(commandParameters); break; case "Withdraw": WithdrawCommand withdeow = new WithdrawCommand(savingService); result = withdeow.Execute(commandParameters); break; case "AddInterest": AddInterestCommand addInterest = new AddInterestCommand(savingService); result = addInterest.Execute(commandParameters); break; case "DeductFee": DeductCommand deduct = new DeductCommand(checkingService); result = deduct.Execute(commandParameters); break; case "Register": RegisterCommand register = new RegisterCommand(userService); result = register.Execute(commandParameters); break; case "Login": LoginCommand login = new LoginCommand(); result = login.Execute(commandParameters); break; case "Logout": Logout logout = new Logout(); result = logout.Execute(); break; case "AddSavingAccount": AddSavingAccountCommand addAccount = new AddSavingAccountCommand(savingService); result = addAccount.Execute(commandParameters); break; case "ListAccounts": ListAccounts listAccounts = new ListAccounts(savingService, checkingService); result = listAccounts.Execute(); break; } return(result); }
/// <summary> /// Call the LoadGame() method from SavingService.cs /// Input fileName is case sensitive, make sure input written excatly like it is a Application.persistentDataPath. /// </summary> /// <param name="fileName"></param> public void loadGame() { SavingService.LoadGame("SaveGame.json"); }
/// <summary> /// Call the SavingService.cs SaveGame method on the current active scene. /// </summary> public void saveGame() { // Save the game to a file called "SaveGame.json" SavingService.SaveGame("SaveGame.json"); }
// Start is called before the first frame update void Start() { SavingService.SaveGame(fileName); }
public void SaveGame() { SavingService.SaveGame("saveGame.json"); }
public RecordingController(RecordingService recordingService, SavingService savingService) { this.savingService = savingService; this.recordingService = recordingService; }
public AddSavingAccountCommand(SavingService savingAccount) { this.savingService = savingAccount; }