Exemplo n.º 1
0
        internal void StoreRecord()
        {
            RailStateRecord record =
                RailState.CreateRecord(
                    this.Room.Tick,
                    this.StateBase,
                    this.outgoingStates.Latest);

            if (record != null)
            {
                this.outgoingStates.Store(record);
            }
        }
Exemplo n.º 2
0
        internal RailStateDelta ProduceDelta(
            Tick basisTick,
            IRailController destination)
        {
            RailStateRecord basis = null;

            if (basisTick.IsValid)
            {
                basis = this.outgoingStates.LatestAt(basisTick);
            }

            // Flags for special data modes
            bool includeControllerData = (destination == this.Controller);
            bool includeImmutableData  = (basisTick.IsValid == false);

            return(RailState.CreateDelta(
                       this.Id,
                       this.StateBase,
                       basis,
                       includeControllerData,
                       includeImmutableData,
                       this.commandAck,
                       this.RemovedTick));
        }