Пример #1
0
        public DefinitionTheaterSpawnPoint(INIFile ini, string key) : this()
        {
            string[] vals = ini.GetValueArray <string>("SpawnPoints", key, ',');
            IsValid  = true;
            UniqueID = key;

            if (vals.Length < 4)
            {
                IsValid = false; return;
            }

            try
            {
                Coordinates = new Coordinates(HQTools.StringToDouble(vals[0]), HQTools.StringToDouble(vals[1]));
                PointType   = (TheaterLocationSpawnPointType)Enum.Parse(typeof(TheaterLocationSpawnPointType), vals[2], true);
                Country     = (DCSCountry)Enum.Parse(typeof(DCSCountry), vals[3], true);
            }
            catch (Exception)
            {
                IsValid = false;
            }
        }