ZoFo/ZoFo/GameCore/GameManagers/ItemManager/ItemManager.cs
2024-08-19 01:10:57 +03:00

39 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZoFo.GameCore.GameManagers.ItemManager
{
public class ItemManager
{
//поля
public Dictionary<string, ItemInfo> tagItemPairs;
//методы
public ItemInfo GetItemInfo(string tag)
{
return tagItemPairs[tag];
}
public void LoadItemTextures()
{
foreach (var item in tagItemPairs)
{
item.Value.LoadTexture();
}
}
public void Initialize()
{
tagItemPairs = new Dictionary<string, ItemInfo>();
tagItemPairs.Add("wood", new ItemInfo("wood", "бревна кусок", "Textures\\Test\\wood",false,null));
tagItemPairs.Add("rock", new ItemInfo("rock", "пять галек", "Textures\\Test\\rock", false, null));
tagItemPairs.Add("steel", new ItemInfo("steel", "метал, метал, \nжелезо, метал", "Textures\\Test\\steel", false, null));
tagItemPairs.Add("pickaxe", new ItemInfo("steel", "прямой путь к \nстановлению каменьщиком", "Textures\\Test\\pickaxe", true, new Dictionary<string, int>()
{
{"wood", 2},
{"steel", 3}
}));
}
}
}