public void Apply(IGate gate) { gate.ApplyTo(ref _states[_currentStateIdx], ref backState); swapStates(); }