コード例 #1
0
 public static GameLocation GetOriginLocation(GameLocation location)
 {
     if (!(location is IHookedLocation))
     {
         return(location);
     }
     return(HookedLocationBuilder.CopyData(location, location.GetType().BaseType));
 }
コード例 #2
0
        /*********
        ** 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]));
        }