internal void Write(StateBinaryWriter writer) { writer.WriteInt(_additionalDemands.Count); foreach (KeyValuePair <VehicleStation, UniqueList <IStorageNetworkNode> > stationPair in _additionalDemands) { writer.WriteBuilding(stationPair.Key); UniqueList <IStorageNetworkNode> list = stationPair.Value; int count = list.Count; writer.WriteInt(count); for (int i = 0; i < list.Count; i++) { writer.WriteBuilding(list[i].Building); } } writer.WriteInt(_connectedStations.Count); foreach (KeyValuePair <VehicleStation, UniqueList <VehicleStation> > stationPair in _connectedStations) { writer.WriteBuilding(stationPair.Key); UniqueList <VehicleStation> list = stationPair.Value; int count = list.Count; writer.WriteInt(count); for (int i = 0; i < list.Count; i++) { writer.WriteBuilding(list[i]); } } }
internal override void Write(StateBinaryWriter writer) { base.Write(writer); writer.WriteBool(_startDistance.HasValue); if (_startDistance.HasValue) { writer.WriteFloat(_startDistance.Value); } }
internal void Write(StateBinaryWriter writer) { writer.WriteInt(_vehiclesData.Count); foreach (KeyValuePair <Vehicle, VehicleScheduleData> pair in _vehiclesData) { writer.WriteInt(pair.Key.Id); pair.Value.Write(writer); } }
internal virtual void Write(StateBinaryWriter writer) { writer.WriteInt(_data.Count); foreach (var pair in _data) { writer.WriteInt(pair.Key.GetIndex()); pair.Value.Write(writer); } }
protected override void Write(StateBinaryWriter writer) { if (SaveSerializer.Current.SchemaVersions.Get <ScheduleStopwatch>() < 3) { writer.WriteByte(SAVE_VERSION); } VehicleScheduleDataManager.Current.Write(writer); LazyManager <StationDemandManager> .Current.Write(writer); }
internal override void Write(StateBinaryWriter writer) { base.Write(writer); writer.WriteInt(_distanceData.Count); foreach (KeyValuePair <RootTask, float> pair in _distanceData) { writer.WriteInt(pair.Key.GetIndex()); writer.WriteFloat(pair.Value); } }
public void Write(StateBinaryWriter writer) { writer.WriteInt(_durationData.Size); foreach (TimeSpan duration in _durationData) { writer.WriteLong(duration.Ticks); } writer.WriteInt(_totalCount); writer.WriteLong(_totalSum.Ticks); }
internal void Write(StateBinaryWriter writer) { _travelData.Write(writer); _stationLoadingData.Write(writer); writer.WriteBool(_measurement != null); if (_measurement != null) { _measurement.Write(writer); } }
internal static void Write(StateBinaryWriter writer, Measurement measurement) { if (measurement is StationLoadingMeasurement) { writer.WriteByte(0); } else if (measurement is TravelMeasurement) { writer.WriteByte(1); } else { throw new ArgumentException("Unknown class " + measurement.GetType().Name); } }
protected override void Write(StateBinaryWriter writer) { writer.WriteBool(OldSchoolStyleManager.Current.Enabled); }
public void Write(StateBinaryWriter writer) { }
internal virtual void Write(StateBinaryWriter writer) { writer.WriteInt(Task.GetIndex()); MeasurementSurrogate.Write(writer, this); writer.WriteLong(startTime.Value.Ticks); }