Пример #1
0
            internal static Measurement Read(StateBinaryReader reader, VehicleScheduleData data, RootTask task)
            {
                byte id = reader.ReadByte();

                switch (id)
                {
                case 0:
                    return(new StationLoadingMeasurement(data, task));

                case 1:
                    return(new TravelMeasurement(data, task));
                }

                throw new ArgumentException("Unknown id " + id.ToString());
            }
        protected override void Read(StateBinaryReader reader)
        {
            _readVersion = null;
            try
            {
                int antVersion = SchemaVersion <ScheduleStopwatch> .Get();

                if (antVersion < 3)
                {
                    _readVersion = reader.ReadByte();
                }
                VehicleScheduleDataManager.Current.Read(reader);
                LazyManager <StationDemandManager> .Current.Read(reader);
            }
            catch (Exception e)
            {
                logger.Log(UnityEngine.LogType.Error, "Error when loading ScheduleStopwatch data");
                logger.LogException(e);
            }
            _readVersion = null;
        }