public static GameLocation GetOriginLocation(GameLocation location) { if (!(location is IHookedLocation)) { return(location); } return(HookedLocationBuilder.CopyData(location, location.GetType().BaseType)); }
/********* ** Public methods *********/ public static GameLocation GetHookedLocation(GameLocation location) { if (location is IHookedLocation) { return(location); } Type type = location.GetType(); if (!HookedLocationBuilder.Cache.ContainsKey(type)) { HookedLocationBuilder.Cache.Add(type, HookedLocationBuilder.BuildHookedLocation(type)); } return(HookedLocationBuilder.CopyData(location, HookedLocationBuilder.Cache[type])); }