public ShBJob(string name) { this.name = name; Resistance = new ShBProgress("Resistance", Name); AugmentedResistance = new ShBProgress("AugmentedResistance", Name); Recollection = new ShBProgress("Recollection", Name); }
public static void ProgressClass(Character character, ShBProgress shbProgress, bool CompleteBool = false) { int StageIndex = ShBInfo.StageListString.IndexOf(shbProgress.Name); int JobIndex = ShBInfo.JobListString.IndexOf(shbProgress.Job); ShBJob tempJob = character.ShBModel.ShbJobList[JobIndex]; if (shbProgress.Progress == ShBProgress.States.NA & StageIndex > 0) { CompletePreviousStages(character, tempJob, StageIndex); } else if (shbProgress.Progress == ShBProgress.States.Completed) { InCompleteFollowingStages(tempJob, StageIndex); return; } if (shbProgress.Progress == ShBProgress.States.Initiated | CompleteBool) { shbProgress.Progress = ShBProgress.States.Completed; AlterCounts(character, StageIndex); } else { IncompleteOtherJobs(character, StageIndex); switch (StageIndex) { case 0: shbProgress.Progress = ShBProgress.States.Completed; break; case 1: shbProgress.Progress = ShBProgress.States.Completed; break; case 2: shbProgress.Progress = ShBProgress.States.Completed; break; case 3: shbProgress.Progress = ShBProgress.States.Completed; break; case 4: shbProgress.Progress = ShBProgress.States.Completed; break; case 5: shbProgress.Progress = ShBProgress.States.Completed; break; default: shbProgress.Progress++; break; } AlterCounts(character, StageIndex); } }
private static void IncompleteOtherJobs(Character SelectedCharacter, int StageIndex) { foreach (ShBJob Job in SelectedCharacter.ShBModel.ShbJobList) { ShBProgress stage = Job.StageList[StageIndex]; if (stage.Progress == ShBProgress.States.Initiated) { stage.Progress = ShBProgress.States.NA; } } }
public void CheckObject() { //This method is used to fix the situation where an existing character is loaded and a new stage was added since the character was initially created //Without checking and replacing the Progress lists and objects, the Progress object is null, regardless of the initiator being in the class constructor // or in the field List <ShBProgress> tempList = new List <ShBProgress>(); for (int stageIndex = 0; stageIndex < StageList.Count; stageIndex++) { ShBProgress ShBProgress = new ShBProgress(); if (StageList[stageIndex] != null) { ShBProgress = StageList[stageIndex]; } if (ShBProgress.Name == null) { ShBProgress tempProgress = new ShBProgress(ShBInfo.StageListString[stageIndex], name); tempList.Add(tempProgress); switch (stageIndex) { case 0: Resistance = tempProgress; break; case 1: AugmentedResistance = tempProgress; break; case 2: Recollection = tempProgress; break; } } else { tempList.Add(ShBProgress); } } StageList = tempList; }