コード例 #1
0
        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]);
                }
            }
        }
コード例 #2
0
 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);
     }
 }
コード例 #4
0
 internal virtual void Write(StateBinaryWriter writer)
 {
     writer.WriteInt(_data.Count);
     foreach (var pair in _data)
     {
         writer.WriteInt(pair.Key.GetIndex());
         pair.Value.Write(writer);
     }
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
     }
 }
コード例 #7
0
 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);
 }
コード例 #8
0
 internal void Write(StateBinaryWriter writer)
 {
     _travelData.Write(writer);
     _stationLoadingData.Write(writer);
     writer.WriteBool(_measurement != null);
     if (_measurement != null)
     {
         _measurement.Write(writer);
     }
 }
コード例 #9
0
 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);
     }
 }
コード例 #10
0
ファイル: OldSchoolStyleMod.cs プロジェクト: voxeltycoon/mods
 protected override void Write(StateBinaryWriter writer)
 {
     writer.WriteBool(OldSchoolStyleManager.Current.Enabled);
 }
コード例 #11
0
 public void Write(StateBinaryWriter writer)
 {
 }
 internal virtual void Write(StateBinaryWriter writer)
 {
     writer.WriteInt(Task.GetIndex());
     MeasurementSurrogate.Write(writer, this);
     writer.WriteLong(startTime.Value.Ticks);
 }