private void updatedInventory(int indexUpdated, Slot slotUpdated)
    {
        InventoryUpdated handler = inventoryUpdatedEvent;

        if (handler != null)
        {
            handler(indexUpdated, slotUpdated);
        }
    }
예제 #2
0
        private void OnInventoryContent(string[] data)
        {
            string[] itemsData = data[3].Split(new string[] { "\r\n" }, StringSplitOptions.None);

            Money = int.Parse(data[2]);

            _inventory = new List <InventoryItem>();
            foreach (string line in itemsData)
            {
                if (line.Length > 0)
                {
                    _inventory.Add(new InventoryItem(line));
                }
            }

            InventoryUpdated?.Invoke();
        }