public static ItemInfo GetItemInfo(string itemTypeName) { ItemInfo retItemInfo = null; if (TypeNameItemInfoPairs.ContainsKey(itemTypeName)) { retItemInfo = TypeNameItemInfoPairs[itemTypeName]; } return(retItemInfo); }
public static void SetNames(IHasID IHasIDIns) { string insTypeName = IHasIDIns.GetType().Name; if (TypeNameItemInfoPairs.ContainsKey(insTypeName)) { ItemInfo itemInfo = TypeNameItemInfoPairs[insTypeName]; IHasIDIns.SetChineseName(itemInfo.chineseName); IHasIDIns.SetEnglishName(itemInfo.englishName); } }