Ejemplo n.º 1
0
        List <PlayerItem> GetItemsForTransfer(StashTransferEventArgs args)
        {
            List <PlayerItem> items = new List <PlayerItem>();

            // Detect the record type (long or string) and add the item(s)
            if (args.HasValidId)
            {
                IList <PlayerItem> tmp = _dao.GetByRecord(args.Prefix, args.BaseRecord, args.Suffix, args.Materia);
                if (tmp.Count > 0)
                {
                    if (args.Count == 1)
                    {
                        items.Add(tmp[0]);
                    }
                    else
                    {
                        items.AddRange(tmp);
                    }
                }
            }

            if (items.Contains(null))
            {
                Logger.Warn("Attempted to transfer NULL item.");

                var message = RuntimeSettings.Language.GetTag("iatag_feedback_item_does_not_exist");
                _setFeedback(message);
                _browser.ShowMessage(message, UserFeedbackLevel.Danger);

                return(null);
            }

            return(items);
        }
Ejemplo n.º 2
0
        List <PlayerItem> GetItemsForTransfer(StashTransferEventArgs args)
        {
            List <PlayerItem> items = new List <PlayerItem>();

            // Detect the record type (long or string) and add the item(s)
            if (args.HasValidId)
            {
                var pid = args.PlayerItemId;
                if (pid.HasValue)
                {
                    var item = _dao.GetById(pid.Value);
                    items.Add(item);
                }
                else
                {
                    IList <PlayerItem> tmp = _dao.GetByRecord(args.Prefix, args.BaseRecord, args.Suffix, args.Materia, args.Mod, args.IsHardcore);
                    if (tmp.Count > 0)
                    {
                        if (!args.TransferAll)
                        {
                            Logger.Warn("Error transferring item, transfer all was false, but no player item id was located.");
                        }
                        else
                        {
                            items.AddRange(tmp);
                        }
                    }
                }
            }

            if (items.Contains(null))
            {
                Logger.Warn("Attempted to transfer NULL item.");

                var message = RuntimeSettings.Language.GetTag("iatag_feedback_item_does_not_exist");
                _setFeedback(message);
                _browser.ShowMessage(message, UserFeedbackLevel.Danger);

                return(null);
            }

            return(items);
        }
Ejemplo n.º 3
0
 public IList <PlayerItem> GetByRecord(string prefixRecord, string baseRecord, string suffixRecord, string materiaRecord)
 {
     return(ThreadExecuter.Execute(
                () => repo.GetByRecord(prefixRecord, baseRecord, suffixRecord, materiaRecord)
                ));
 }
Ejemplo n.º 4
0
 public IList <PlayerItem> GetByRecord(string prefixRecord, string baseRecord, string suffixRecord, string materiaRecord, string mod, bool isHardcore)
 {
     return(ThreadExecuter.Execute(
                () => _repo.GetByRecord(prefixRecord, baseRecord, suffixRecord, materiaRecord, mod, isHardcore)
                ));
 }