Exemplo n.º 1
0
        private void AddOrRemoveItem(TradeInventoryTypes type, UnitObject item, bool removeItem)
        {
            // get corresponding inventory
            bool[,] inventory = _charInventory[(int)type];

            int x = item.InventoryPositionX;
            int y = item.InventoryPositionY;

            int width  = UnitHelpFunctions.GetSimpleValue(item, ItemValueNames.inventory_width.ToString());
            int height = UnitHelpFunctions.GetSimpleValue(item, ItemValueNames.inventory_height.ToString());

            if (width <= 0)
            {
                width = 1;
            }
            if (height <= 0)
            {
                height = 1;
            }

            AllocateInventorySpace(inventory, x, y, width, height, removeItem);
        }
Exemplo n.º 2
0
        private void AddOrRemoveItem2(TradeInventoryTypes type, CharacterItems item, bool removeItem)
        {
            // get corresponding inventory
            bool[,] inventory = _charInventory[(int)type];

            int x = item.InventoryPosition.X;
            int y = item.InventoryPosition.Y;

            int width  = item.InventorySize.Width;
            int height = item.InventorySize.Height;

            if (width <= 0)
            {
                width = 1;
            }
            if (height <= 0)
            {
                height = 1;
            }

            AllocateInventorySpace(inventory, x, y, width, height, removeItem);
        }
Exemplo n.º 3
0
        public void RemoveItem(UnitObject item)
        {
            // get inventory type that the item uses
            TradeInventoryTypes type = TradeInventoryTypes.Inventory;

            if (item.InventoryLocationIndex == (int)InventoryTypes.Cube)
            {
                type = TradeInventoryTypes.Cube;
            }
            else if (item.InventoryLocationIndex == (int)InventoryTypes.Stash)
            {
                type = TradeInventoryTypes.Stash;
            }
            else if (item.InventoryLocationIndex == (int)InventoryTypes.Inventory)
            {
                type = TradeInventoryTypes.Inventory;
            }
            else
            {
                return;
            }

            AddOrRemoveItem(type, item, true);
        }
Exemplo n.º 4
0
        public void AddItem2(CharacterItems item)
        {
            // get inventory type that the item uses
            TradeInventoryTypes type = TradeInventoryTypes.Inventory;

            if (item.InventoryType == InventoryTypes.Cube)
            {
                type = TradeInventoryTypes.Cube;
            }
            else if (item.InventoryType == InventoryTypes.Stash)
            {
                type = TradeInventoryTypes.Stash;
            }
            else if (item.InventoryType == InventoryTypes.Inventory)
            {
                type = TradeInventoryTypes.Inventory;
            }
            else
            {
                return;
            }

            AddOrRemoveItem2(type, item, false);
        }
Exemplo n.º 5
0
        private void AddOrRemoveItem2(TradeInventoryTypes type, CharacterItems item, bool removeItem)
        {
            // get corresponding inventory
            bool[,] inventory = _charInventory[(int)type];

            int x = item.InventoryPosition.X;
            int y = item.InventoryPosition.Y;

            int width = item.InventorySize.Width;
            int height = item.InventorySize.Height;

            if (width <= 0)
            {
                width = 1;
            }
            if (height <= 0)
            {
                height = 1;
            }

            AllocateInventorySpace(inventory, x, y, width, height, removeItem);
        }
Exemplo n.º 6
0
        private void AddOrRemoveItem(TradeInventoryTypes type, UnitObject item, bool removeItem)
        {
            // get corresponding inventory
            bool[,] inventory = _charInventory[(int)type];

            int x = item.InventoryPositionX;
            int y = item.InventoryPositionY;

            int width = UnitHelpFunctions.GetSimpleValue(item, ItemValueNames.inventory_width.ToString());
            int height = UnitHelpFunctions.GetSimpleValue(item, ItemValueNames.inventory_height.ToString());

            if (width <= 0)
            {
                width = 1;
            }
            if (height <= 0)
            {
                height = 1;
            }

            AllocateInventorySpace(inventory, x, y, width, height, removeItem);
        }