Ejemplo n.º 1
0
 public void Stop(InventoryObject _inventory)
 {
     if (base.Stop() && _inventory != null)
     {
         _inventory.Action(this);
     }
 }
Ejemplo n.º 2
0
        public void Update(InventoryObject _inventory)
        {
            if (_inventory == null)
            {
                return;
            }

            if (base.Update())
            {
                _inventory.Action(this);
            }
        }
Ejemplo n.º 3
0
        public void Update(InventoryObject _inventory)
        {
            if (!Enabled || _inventory == null)
            {
                return;
            }

            foreach (InventoryActionDataObject _action in ActionList)
            {
                _action.Update(_inventory);
            }
        }
Ejemplo n.º 4
0
        public void Insert(InventoryObject _inventory)
        {
            if (_inventory == null)
            {
                return;
            }

            foreach (InventorySlotObject _slot in _inventory.Slots)
            {
                _slot.Amount = Insert(_slot.ItemName, _slot.Amount);
            }
        }
Ejemplo n.º 5
0
        public void Stop(ICEWorldBehaviour _component)
        {
            InventoryObject    _inventory = null;
            ICECreatureControl _control   = _component as ICECreatureControl;

            if (_control != null)
            {
                _inventory = _control.Creature.Status.Inventory;
            }

            foreach (InventoryActionDataObject _action in ActionList)
            {
                _action.Stop(_inventory);
            }
        }
Ejemplo n.º 6
0
        public static InventorySlotObject GetInventorySlot(GameObject _object, string _slot)
        {
            if (_object == null)
            {
                return(null);
            }

            InventoryObject _inventory = GetInventory(_object);

            if (_inventory != null)
            {
                return(_inventory.GetSlotByItemName(_slot));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 7
0
        public void Copy(InventoryObject _inventory)
        {
            if (_inventory == null)
            {
                return;
            }

            base.Copy(_inventory);

            MaxSlots              = _inventory.MaxSlots;
            IgnoreInventoryOwner  = _inventory.IgnoreInventoryOwner;
            DefaultDropRange      = _inventory.DefaultDropRange;
            LastCollectedObjectID = _inventory.LastCollectedObjectID;
            UseDetachOnDie        = _inventory.UseDetachOnDie;

            Slots.Clear();
            foreach (InventorySlotObject _slot in _inventory.Slots)
            {
                Slots.Add(new InventorySlotObject(OwnerComponent, _slot));
            }
        }
Ejemplo n.º 8
0
        public static InventoryObject GetInventory(GameObject _object)
        {
            if (_object == null)
            {
                return(null);
            }

            ICECreatureEntity _entity    = _object.GetComponent <ICECreatureEntity>();
            InventoryObject   _inventory = null;

            if (_entity != null)
            {
                if (_entity as ICECreatureControl != null)
                {
                    ICECreatureControl _creature = _entity as ICECreatureControl;
                    if (_creature != null)
                    {
                        _inventory = _creature.Creature.Status.Inventory;
                    }
                }
                else if (_entity as ICECreaturePlayer != null)
                {
                    ICECreaturePlayer _player = _entity as ICECreaturePlayer;
                    if (_player != null)
                    {
                        _inventory = _player.Inventory;
                    }
                }
                else if (_entity as ICECreatureItem != null)
                {
                    ICECreatureItem _item = _entity as ICECreatureItem;
                    if (_item != null)
                    {
                        _inventory = _item.Inventory;
                    }
                }
            }

            return(_inventory);
        }
Ejemplo n.º 9
0
 public InventoryObject(InventoryObject _inventory) : base(_inventory)
 {
 }