protected virtual void MetadataSelected( MenuSceneInfo sceneInfo, MenuEncounter menuEncounter, TaskResult <KeyValuePair <SaveType, EncounterMetadata> > metadata) { if (metadata.HasValue()) { EnsureEncounterUnlocked(sceneInfo, menuEncounter, metadata.Value); } }
protected virtual void SelectMetadata(MenuSceneInfo sceneInfo, MenuEncounter menuEncounter) { if (MetadataSelector == null) { EnsureEncounterUnlocked(sceneInfo, menuEncounter, menuEncounter.GetLatestTypedMetada()); return; } var result = MetadataSelector.GetMetadata(menuEncounter); result.AddOnCompletedListener((value) => MetadataSelected(sceneInfo, menuEncounter, value)); }
public virtual void StartEncounter(MenuSceneInfo sceneInfo, MenuEncounter menuEncounter) { if (MetadataSelector == null) { MetadataSelected(sceneInfo, menuEncounter.Status, menuEncounter.GetLatestTypedMetada()); return; } var result = MetadataSelector.GetMetadata(menuEncounter); result.AddOnCompletedListener((value) => MetadataSelected(sceneInfo, menuEncounter.Status, value)); }
protected virtual void EnsureEncounterUnlocked( MenuSceneInfo sceneInfo, MenuEncounter menuEncounter, KeyValuePair <SaveType, EncounterMetadata> metadata) { if (menuEncounter.Metadata.ContainsKey(SaveType.Server)) { var task = EncounterLocker.LockEncounter(sceneInfo.User, metadata.Value); task.AddOnCompletedListener((result) => EncounterLocked(result, sceneInfo, metadata)); } else { StartWriter(sceneInfo, metadata); } }
protected virtual MenuEncounter GetMenuEncounter( KeyValuePair <int, Dictionary <SaveType, EncounterMetadata> > metadataGroup, WaitableTask <Dictionary <int, EncounterEditLock> > locks, WaitableTask <Dictionary <int, EncounterBasicStatus> > statuses) { EncounterBasicStatus status = null; if (statuses.Result.Value?.ContainsKey(metadataGroup.Key) == true) { status = statuses.Result.Value[metadataGroup.Key]; } var menuEncounter = new MenuEncounter(metadataGroup.Value, status); if (!locks.Result.IsError() && locks.Result.Value?.ContainsKey(metadataGroup.Key) == true) { menuEncounter.Lock = locks.Result.Value[metadataGroup.Key]; } return(menuEncounter); }
public void RemoveEncounter(MenuEncounter encounter) { Encounters.Remove(encounter); EncountersChanged?.Invoke(); }
public bool ContainsEncounter(MenuEncounter encounter) => Encounters.Contains(encounter);
public void AddEncounter(MenuEncounter encounter) { Encounters.Add(encounter); EncountersChanged?.Invoke(); }
public abstract WaitableTask <KeyValuePair <SaveType, EncounterMetadata> > GetMetadata(MenuEncounter menuEncounter);
public MenuEncounterSelectedEventArgs(MenuEncounter encounter, EncounterSelectionType selectionType) { Encounter = encounter; SelectionType = selectionType; }
public virtual void StartEncounter(MenuSceneInfo sceneInfo, MenuEncounter menuEncounter) => SelectMetadata(sceneInfo, menuEncounter);
public abstract void Display(MenuSceneInfo sceneInfo, MenuEncounter encounter);