internal void SetSpec(UnitTypeName type, int id, string key, double value) { if (!_unitTypes.ContainsKey(type)) { Trace.WriteLine("No type description for type " + type); _unitTypes.Add(type, new UnitType(id, "Unknown", Constants.DefaultCountry)); } _unitTypes[type].SetSpec(id, key, value); }
internal void AddUnitType(UnitTypeName type, int id, string name, string country = Constants.DefaultCountry) { if (_unitTypes.ContainsKey(type)) { _unitTypes[type].SetModel(id, name, country); } else { _unitTypes.Add(type, new UnitType(id, name, country)); } }
public IUnitType UnitType(UnitTypeName type) { UnitType ret; if (!_unitTypes.TryGetValue(type, out ret)) { ret = new UnitType(0, "Unknown"); } return(ret); }