Beispiel #1
0
        /// <summary>
        /// Creates a TunnelExit object out of a CSV file string
        /// </summary>
        private TunnelExit CreateTunnelExitObject(string tunnelExitString)
        {
            TunnelExit tunnelExit = new TunnelExit();

            try
            {
                string[] tunnelExitStringData = tunnelExitString.Split(Devider);
                CheckAndCorrectInputStringData(tunnelExitStringData);

                tunnelExit = new TunnelExit
                {
                    ID        = long.Parse(tunnelExitStringData[IDIndex]),
                    RowNum    = int.Parse(tunnelExitStringData[RowNumIndex]),
                    Name      = tunnelExitStringData[NameIndex],
                    Tunnel    = Tunnel.Parse(tunnelExitStringData[TunnelIndex]),
                    AdmArea   = tunnelExitStringData[AdmAreaIndex],
                    District  = tunnelExitStringData[DistrictIndex],
                    Latitude  = double.Parse(tunnelExitStringData[LatitudeIndex].Replace('.', ',')),
                    Longitude = double.Parse(tunnelExitStringData[LongitudeIndex].Replace('.', ',')),
                    IsDamaged = "OK"
                };
                return(tunnelExit);
            }
            catch (ArgumentNullException)
            {
                tunnelExit.IsDamaged = "Damaged";
                return(tunnelExit);
            }
            catch (Exception)
            {
                tunnelExit.IsDamaged = "Damaged";
                return(tunnelExit);
            }
        }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         print("ERROR: TunnelExit class is singelton");
     }
 }
Beispiel #3
0
        public TunnelExitModel(TunnelExit tunnelExit)
        {
            IsSelected = false;

            RowNum            = tunnelExit.RowNum;
            ID                = tunnelExit.ID;
            Name              = tunnelExit.Name;
            TunnelGlobalID    = tunnelExit.Tunnel.GlobalID;
            TunnelDescription = tunnelExit.Tunnel.Name;
            AdmArea           = tunnelExit.AdmArea;
            District          = tunnelExit.District;
            Longitude         = tunnelExit.Longitude;
            Latitude          = tunnelExit.Latitude;

            IsDamaged = tunnelExit.IsDamaged;
        }