public static void checkAndInjectDynamicObject(OverlaidDictionary objects, Vector2 key)
 {
     if (!(objects[key] is IBigCraftable) && wrappers.ContainsKey(objects[key].name))
     {
         IBigCraftableWrapper wrapper = wrappers[objects[key].name];
         objects[key] = (IBigCraftable)Activator.CreateInstance(wrapper.dynamicObjectType, objects[key], wrapper);
     }
 }
Esempio n. 2
0
        public static void injectDynamicsInCurrentLocation()
        {
            OverlaidDictionary objects = Game1.currentLocation.objects;

            foreach (Vector2 key in objects.Keys)
            {
                IBigCraftableWrapper.checkAndInjectDynamicObject(objects, key);
            }
        }
Esempio n. 3
0
 public static void removeDynamicsInAllLocations()
 {
     foreach (GameLocation location in Game1.locations)
     {
         OverlaidDictionary objects = location.objects;
         foreach (Vector2 key in objects.Keys)
         {
             IBigCraftableWrapper.checkAndRemoveDynamicObject(objects, key);
         }
     }
 }
Esempio n. 4
0
        public IBigCraftable(StardewValley.Object baseObject, IBigCraftableWrapper wrapper)
            : base(
                baseObject.TileLocation,
                baseObject.ParentSheetIndex
                )
        {
            this.baseObject = baseObject;
            this.wrapper    = wrapper;

            this.animate();
        }
Esempio n. 5
0
 public SeedBandit(StardewValley.Object baseObject, IBigCraftableWrapper wrapper)
     : base(baseObject, wrapper)
 {
 }
Esempio n. 6
0
 public SeedBandit() : base()
 {
     this.wrapper = IBigCraftableWrapper.getWrapper("Seed Bandit");
     this.animate();
 }
 public static void addWrapper(IBigCraftableWrapper wrapper)
 {
     wrappers.Add(wrapper.name, wrapper);
 }
Esempio n. 8
0
 public SeedMachine() : base()
 {
     this.wrapper = IBigCraftableWrapper.getWrapper("Seed Machine");
     this.animate();
 }