Esempio n. 1
0
 //
 public ItemFullHelper(IInteractiveStorage <T> source, T item, string context, bool inCombat, Action resumeCallback,
                       Action returnItemFunction = null, Action cancelItemOverride = null)
 {
     this.inventory       = source ?? throw new ArgumentNullException(nameof(source));
     this.item            = item ?? throw new ArgumentNullException(nameof(item));
     this.context         = context;
     isInCombat           = inCombat;
     this.resumeCallback  = resumeCallback ?? throw new ArgumentNullException(nameof(resumeCallback));
     this.returnCallback  = returnItemFunction;
     this.abandonCallback = cancelItemOverride ?? DefaultAbandonAction;
 }
        public static void AddItem <T>(IInteractiveStorage <T> storage, T item, DisplayBase displayPage) where T : CapacityItem
        {
            int storeLocation = storage.TryAddItem(item);

            if (storeLocation != -1)
            {
                displayPage.OutputText(storage.PlaceItemInSlot(item, (byte)storeLocation));
            }
            else
            {
                displayPage.OutputText("Generic item full text");
            }
        }