public EventStage this[string key] { get { EventStage result; if (String.IsNullOrEmpty(key)) { result = EventStages[Default]; result.StageID = Default; return(result); } if (EventStages.ContainsKey(key)) { result = EventStages[key]; result.StageID = key; return(result); } Debug.LogWarning($"Requested sublocation {key} is not present in location {id}"); result = EventStages[Default]; result.StageID = Default; return(result); } }
public EventStage this[string key] { get { try { EventStage result; if (String.IsNullOrEmpty(key)) { result = EventStages[Default]; result.StageID = Default; return(result); } if (EventStages.ContainsKey(key)) { result = EventStages[key]; result.StageID = key; return(result); } Debug.LogWarning($"Requested sublocation {key} is not present in event {id}"); result = EventStages[Default]; result.StageID = Default; return(result); } catch { string json = JsonConvert.SerializeObject(EventStages, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); Debug.LogWarning(json); return(default);
public SubLocation this[string key] { get { //SubLocation result; if (String.IsNullOrEmpty(key)) { return(Inheritable.Inherited(subLocations[Default])); } else if (subLocations.ContainsKey(key)) { return(Inheritable.Inherited(subLocations[key])); } else { ErrorMessage.Show($"Requested sublocation {key} is not present in location {ID}"); return(Inheritable.Inherited(subLocations[Default])); } } }