/// formulate array of changed static (boolean) recorder object
        /// states for storage with delta compression
        private BooleanDeltaState[] RecordStaticStates(
            StaticRecorder[] statics)
        {
            // how many states have changed?

            int numChanged = 0;

            for (int i = 0; i < statics.Length; i++)
            {
                statics[i].CheckForChanges();

                if (statics[i].StateHasChanged())
                {
                    numChanged++;
                }
            }

            // record those changes

            BooleanDeltaState[] deltas = new BooleanDeltaState[numChanged];

            for (int i = 0, j = 0; i < statics.Length; i++)
            {
                if (statics[i].StateHasChanged())
                {
                    deltas[j++] =
                        new BooleanDeltaState(i, statics[i].LastState());
                }
            }

            return(deltas);
        }
        /// Apply this frame's information to these replayer objects
        /// so that they match the frame
        public void Apply(
            DynamicReplayer[] dynamics, StaticReplayer[] statics)
        {
            // apply dynamic states from this frame

            for (int i = 0; i < this.dynamics.Length; i++)
            {
                DynamicDeltaState state = this.dynamics[i];

                dynamics[state.index].SetState(new DynamicState(
                                                   new Vector2(state.positionX, state.positionY),
                                                   new Vector2(state.velocityX, state.velocityY)
                                                   ));
            }

            // apply static states from this frame

            for (int i = 0; i < this.statics.Length; i++)
            {
                BooleanDeltaState state = this.statics[i];

                statics[state.index].SetState(state.state);
            }
        }