@@ -26,11 +26,17 @@ public class StateMachineRouteID<S: StateType, E: StateEventType>
2626 self . transition = transition
2727 self . routeKey = routeKey
2828 self . event = event
29+
30+ self . bundledRouteIDs = nil
2931 }
3032
3133 private init ( bundledRouteIDs: [ StateMachineRouteID < S , E > ] ? )
3234 {
3335 self . bundledRouteIDs = bundledRouteIDs
36+
37+ self . transition = nil
38+ self . routeKey = nil
39+ self . event = nil
3440 }
3541}
3642
@@ -48,11 +54,16 @@ public class StateMachineHandlerID<S: StateType, E: StateEventType>
4854 {
4955 self . transition = transition
5056 self . handlerKey = handlerKey
57+
58+ self . bundledHandlerIDs = nil
5159 }
5260
5361 private init ( bundledHandlerIDs: [ StateMachineHandlerID < S , E > ] ? )
5462 {
5563 self . bundledHandlerIDs = bundledHandlerIDs
64+
65+ self . transition = nil
66+ self . handlerKey = nil
5667 }
5768}
5869
@@ -339,11 +350,6 @@ public class StateMachine<S: StateType, E: StateEventType>
339350 return self . addRoute ( route)
340351 }
341352
342- public func addRoute( transition: Transition , condition: @autoclosure ( ) -> Bool ) -> RouteID
343- {
344- return self . addRoute ( transition, condition: { t in condition ( ) } )
345- }
346-
347353 public func addRoute( route: Route ) -> RouteID
348354 {
349355 return self . _addRoute ( route)
@@ -389,11 +395,6 @@ public class StateMachine<S: StateType, E: StateEventType>
389395 return self . addRoute ( route, handler: handler)
390396 }
391397
392- public func addRoute( transition: Transition , condition: @autoclosure ( ) -> Bool , handler: Handler ) -> ( RouteID , HandlerID )
393- {
394- return self . addRoute ( transition, condition: { t in condition ( ) } , handler: handler)
395- }
396-
397398 public func addRoute( route: Route , handler: Handler ) -> ( RouteID , HandlerID )
398399 {
399400 let transition = route. transition
@@ -621,11 +622,6 @@ public class StateMachine<S: StateType, E: StateEventType>
621622 return self . addRouteChain ( routeChain, handler: handler)
622623 }
623624
624- public func addRouteChain( chain: TransitionChain , condition: @autoclosure ( ) -> Bool , handler: Handler ) -> ( RouteID , HandlerID )
625- {
626- return self . addRouteChain ( chain, condition: { t in condition ( ) } , handler: handler)
627- }
628-
629625 public func addRouteChain( chain: RouteChain , handler: Handler ) -> ( RouteID , HandlerID )
630626 {
631627 var routeIDs : [ RouteID ] = [ ]
@@ -787,11 +783,6 @@ public class StateMachine<S: StateType, E: StateEventType>
787783 return self . addRouteEvent ( event, routes: routes)
788784 }
789785
790- public func addRouteEvent( event: Event , transitions: [ Transition ] , condition: @autoclosure ( ) -> Bool ) -> [ RouteID ]
791- {
792- return self . addRouteEvent ( event, transitions: transitions, condition: { t in condition ( ) } )
793- }
794-
795786 public func addRouteEvent( event: Event , routes: [ Route ] ) -> [ RouteID ]
796787 {
797788 var routeIDs : [ RouteID ] = [ ]
@@ -818,11 +809,6 @@ public class StateMachine<S: StateType, E: StateEventType>
818809
819810 return ( routeIDs, handlerID)
820811 }
821-
822- public func addRouteEvent( event: Event , transitions: [ Transition ] , condition: @autoclosure ( ) -> Bool , handler: Handler ) -> ( [ RouteID ] , HandlerID )
823- {
824- return self . addRouteEvent ( event, transitions: transitions, condition: { t in condition ( ) } , handler: handler)
825- }
826812
827813 public func addRouteEvent( event: Event , routes: [ Route ] , handler: Handler ) -> ( [ RouteID ] , HandlerID )
828814 {
0 commit comments