Пример #1
0
        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);
        }
Пример #2
0
 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));
     }
 }
Пример #3
0
        public IUnitType UnitType(UnitTypeName type)
        {
            UnitType ret;

            if (!_unitTypes.TryGetValue(type, out ret))
            {
                ret = new UnitType(0, "Unknown");
            }

            return(ret);
        }