 	@StateChart (chart) ->
 		@::__statechart = {} unless @::__statechart?
 
-		addStackedStates = (statesObj) ->
+		addPaths = (statesObj, parent) ->
 			for name,defn of statesObj
 				@::__statechart[name] =
-					name   : name
-					actions: defn.actions
-					methods: defn.methods
+					name       : name
+					transitions: defn.transitions
+					methods    : defn.methods
+					parent     : parent
 			
 				# TODO: validate contents for state
 			
-				addStackedStates defn.states
+				addPaths defn.paths
 
-		addStackedStates chart
+		addPaths paths
+		
+		# TODO: confirm integrity of chart, makes sure all entry / exit points are accounted for
 		
 	constructor: (config) ->
 		return unless @__statechart?

		
	dispose: -> @removeAllListeners()


	setState: (stateObj) ->
		oldState = @__state
		@__state = stateObj
		
		@removeMethods oldState.methods
		@addMethods @__state.methods
		@buildActions @__state.actions
	
	removeMethods: (methods) ->
		return unless methods?

			@["_#{method}"] = @[method] if @[method]?
			@[method] = impl
	
	buildTransitions: (transitions) ->
		for t in transitions
			destination = @pathResolver t.destination
			chgMethod = @[t.method]
			@[t.method] = =>
				result = chgMethod.apply @, arguments
				@setState = destination unless result is true
	
	pathResolver: (path) ->
		steps = path.split '/'
		isRelative = path.indexOf '..' is 0
		
		for step in steps
			
	
module.exports = Stateful