RealizeMethodsInItemManager
This commit is contained in:
parent
ba42178c38
commit
a779d9078e
2 changed files with 25 additions and 3 deletions
|
@ -15,10 +15,23 @@ namespace ZoFo.GameCore.GameManagers.ItemManager
|
|||
Texture2D itemTexture;
|
||||
bool isCraftable;
|
||||
Dictionary<string, int> resourcesNeededToCraft;
|
||||
public ItemInfo (string tag)
|
||||
{
|
||||
this.tag = tag;
|
||||
}
|
||||
public ItemInfo(string tag,string textureName,bool isCraftable, Dictionary<string, int> resourcesNeededToCraft)
|
||||
{
|
||||
this.tag = tag;
|
||||
this.textureName = textureName;
|
||||
|
||||
this.isCraftable = isCraftable;
|
||||
this.resourcesNeededToCraft = resourcesNeededToCraft;
|
||||
}
|
||||
//методы
|
||||
private void LoadTexture()
|
||||
public void LoadTexture()
|
||||
{
|
||||
//я что-то хз как это
|
||||
itemTexture=AppManager.Instance.Content.Load<Texture2D>(textureName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,9 +15,18 @@ namespace ZoFo.GameCore.GameManagers.ItemManager
|
|||
{
|
||||
return tagItemPairs.GetValueOrDefault(tag);
|
||||
}
|
||||
void LoadItemTexture()
|
||||
void LoadItemTextures()
|
||||
{
|
||||
|
||||
foreach (var item in tagItemPairs)
|
||||
{
|
||||
item.Value.LoadTexture();
|
||||
}
|
||||
}
|
||||
void Initialize()
|
||||
{
|
||||
tagItemPairs.Add("wood", new ItemInfo("wood","wood",false,null));
|
||||
tagItemPairs.Add("rock", new ItemInfo("rock", "rock", false, null));
|
||||
tagItemPairs.Add("steel", new ItemInfo("steel", "steel", false, null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue