public static StatusSave SaveProfileWithNewName(Profiles profiles, Profile profile, string newProfileName) { var result = new StatusSave(); // does an profile with the same name already exist var existingProfile = GetProfileByName(profiles, profile.Name); if (existingProfile != null) { // a profile with the same name already existed and we're allowed overwrite it profiles = DeleteProfile(profiles, existingProfile, true); profile.Name = newProfileName; profiles.Items.Add(profile); result.Profiles = SaveProfiles(profiles); } // finish setting the status if (result.Profiles == null) { if (result.Message == string.Empty) { result.Message = "There was an problem saving the profile."; } } else { result.Successful = true; result.Message = "The profile was saved successfully."; } return(result); }
public StatusBlockSave getStatusBlockSave() { StatusBlockSave.Builder builder = StatusBlockSave.CreateBuilder(); foreach (StatusCheckable s in statuses) { StatusSave.Builder sBuilder = StatusSave.CreateBuilder(); sBuilder.SetAlreadyMet(s.isStatusMet()); s.setBuilderWithData(ref sBuilder); builder.AddStats(sBuilder.Build()); } return(builder.Build()); }
/** * Sets teh given quest save data protobuf with this step information */ public void setQuestWithStepInformation(ref QuestSave.Builder builder) { foreach (KeyValuePair <StatusCheckable, bool> pair in statuses) { StatusSave.Builder sBuilder = StatusSave.CreateBuilder(); sBuilder.SetAlreadyMet(pair.Value); pair.Key.setBuilderWithData(ref sBuilder); builder.AddCurrentStepData(sBuilder.Build()); } foreach (Point p in spawnLocations) { PointProto.Builder pBuilder = PointProto.CreateBuilder(); pBuilder.SetX(p.x); pBuilder.SetY(p.y); builder.AddCurrentStepSpawnLocations(pBuilder.Build()); } }
public AlternativeSave getAlternativeSave() { AlternativeSave.Builder builder = AlternativeSave.CreateBuilder(); builder.SetUid(uid); foreach (List <StatusCheckable> l in alternativeRequirment) { StatusBlockSave.Builder bBuilder = StatusBlockSave.CreateBuilder(); foreach (StatusCheckable s in l) { StatusSave.Builder sBuilder = StatusSave.CreateBuilder(); sBuilder.SetAlreadyMet(s.isStatusMet()); s.setBuilderWithData(ref sBuilder); bBuilder.AddStats(sBuilder.Build()); } builder.AddStats(bBuilder.Build()); } return(builder.Build()); }
/** * Set this status checkable with the given saveData */ public void setFromData(StatusSave saveData) { }
public void setFromData(StatusSave saveData) { currentAmount = saveData.Count; }