public void AddItem(Item item) { if (!isInventoryFull) { inventory.Add(item); if (isStorage && typeof(Resource) == item.GetType()) { resourceManager.AddResorces((Resource)item); } if (inventory.Count >= inventoryLenth) { isInventoryFull = true; } } }