public override void DecodePayload( IRailCommandConstruction commandCreator, IRailStateConstruction stateCreator, RailBitBuffer buffer) { // Read: [Deltas] DecodeDeltas(stateCreator, buffer); }
public static RailCommandUpdate Create( IRailCommandConstruction commandCreator, RailEntityClient entity, IEnumerable <RailCommand> commands) { RailCommandUpdate update = commandCreator.CreateCommandUpdate(); update.Initialize(entity.Id, commands); update.Entity = entity; return(update); }
public override void DecodePayload( IRailCommandConstruction commandCreator, IRailStateConstruction stateCreator, RailBitBuffer buffer) { // Read: [Commands] DecodeCommands(commandCreator, buffer); // Read: [View] DecodeView(buffer); }
public static RailCommand Decode( IRailCommandConstruction commandCreator, RailBitBuffer buffer) { RailCommand command = commandCreator.CreateCommand(); // Read: [SenderTick] command.ClientTick = buffer.ReadTick(); // Read: [Command Data] command.DataSerializer.DecodeData(buffer); return(command); }
public static void Decode( this RailPacketIncoming packet, IRailCommandConstruction commandCreator, IRailStateConstruction stateCreator, IRailEventConstruction eventCreator, RailBitBuffer buffer) { // Read: [Header] DecodeHeader(packet, buffer); // Read: [Events] (Early Pack) DecodeEvents(packet, eventCreator, buffer); // Read: [Payload] packet.DecodePayload(commandCreator, stateCreator, buffer); // Read: [Events] (Fill Pack) DecodeEvents(packet, eventCreator, buffer); }
public static RailCommandUpdate Decode( IRailCommandConstruction commandCreator, RailBitBuffer buffer) { RailCommandUpdate update = commandCreator.CreateCommandUpdate(); // Read: [EntityId] update.EntityId = buffer.ReadEntityId(); // Read: [Count] int count = (int)buffer.Read(BUFFER_COUNT_BITS); // Read: [Commands] for (int i = 0; i < count; i++) { update.commands.Store(RailCommand.Decode(commandCreator, buffer)); } return(update); }
private void DecodeCommands(IRailCommandConstruction commandCreator, RailBitBuffer buffer) { commandUpdates.Decode(buffer, buf => RailCommandUpdate.Decode(commandCreator, buf)); }
public abstract void DecodePayload( IRailCommandConstruction commandCreator, IRailStateConstruction stateCreator, RailBitBuffer buffer);