Example #1
0
        internal void MoveObjectsToStorage(Farmer who)
        {
            Log.D($"Moving objects to Storage from {Name}",
                  ModEntry.Instance.Config.DebugMode);

            foreach (var obj in Objects.Values)
            {
                if (obj.GetType() != typeof(Chest))
                {
                    ModEntry.AddToStorage(who, obj);
                }
                else
                {
                    // Deposit chest contents into storage
                    foreach (var chest in ((Chest)obj).items)
                    {
                        ModEntry.AddToStorage(who, chest);
                    }
                    ModEntry.AddToStorage(who, (Chest)obj);
                }
            }
            Objects.Clear();

            // TODO: BUGS: Ensure decoratable location issues with locations added by TMXL are resolved

            foreach (var f in furniture)
            {
                ModEntry.AddToStorage(who, f);
            }
            furniture.Clear();
        }