コード例 #1
0
        public AdvancedBuyInfo(
            AdvancedSBInfo parent,
            Type type,
            int price,
            string name   = null,
            int amount    = 100,
            object[] args = null)
            : base(name, type, price, amount, 0x14F0, 0, args)
        {
            Parent = parent;

            var e = GetDisplayEntity();

            if (e is Mobile)
            {
                var m = (Mobile)e;

                if (String.IsNullOrWhiteSpace(name))
                {
                    Name = m.RawName ?? type.Name.SpaceWords();
                }
                else
                {
                    m.RawName = name;
                }

                ItemID = ShrinkTable.Lookup(m);
                Hue    = m.Hue;

                if (m is BaseCreature)
                {
                    Slots = ((BaseCreature)m).ControlSlots;
                }
            }
            else if (e is Item)
            {
                var i = (Item)e;

                if (String.IsNullOrWhiteSpace(name))
                {
                    Name = i.ResolveName();
                }
                else
                {
                    i.Name = name;
                }

                ItemID = i.ItemID;
                Hue    = i.Hue;
            }
            else if (String.IsNullOrWhiteSpace(name))
            {
                Name = type.Name.SpaceWords();
            }
        }
コード例 #2
0
        public sealed override void InitSBInfo()
        {
            ClearBuyInfo();

            _SBInfos.Add(AdvancedStock = new AdvancedSBInfo(this));

            InitBuyInfo();

            if (OnInit != null)
            {
                OnInit(AdvancedStock);
            }
        }
コード例 #3
0
        public override sealed void InitSBInfo()
        {
            _SBInfos.ForEach(sb => sb.BuyInfo.ForEach(b => b.DeleteDisplayEntity()));
            _SBInfos.Clear();

            _SBInfos.Add(AdvancedStock = new AdvancedSBInfo(this));

            InitBuyInfo();

            if (OnInit != null)
            {
                OnInit(AdvancedStock);
            }
        }
コード例 #4
0
        public AdvancedSellInfo(AdvancedSBInfo parent)
        {
            Parent = parent;

            Table = _TableField.GetValue(this) as Dictionary <Type, int> ?? new Dictionary <Type, int>();
        }