Ejemplo n.º 1
0
        public string createState(FSM fsm, string father, string next)
        {
            fsm_ = fsm;
            prefix_ = father;
            fsm_.addState (prefix_ + ".show", showState(), father);
            fsm_.addState (prefix_ + ".input", inputState(), father);
            fsm_.addState (prefix_ + ".over", overState (next), father);

            return father + ".show";
        }
Ejemplo n.º 2
0
        public string createState(FSM fsm, string father, string next)
        {
            prefix_ = father;
            fsm_ = fsm;

            fsm.addState (prefix_+".input", nomalState (), father);
            fsm.addState (prefix_+".down", downState (), father);
            fsm.addState (prefix_+".up", upState (), father);
            fsm.addState (prefix_+".next", nextState (next), father);
            return prefix_+".input";
        }
Ejemplo n.º 3
0
 public string createState(FSM fsm, string father, string next)
 {
     fsm_ = fsm;
     prefix_ = father;
     fsm_.addState (prefix_ + ".game", new State(), father);
     fsm_.addState (prefix_ + ".load", loadState (), father);
     fsm_.addState (prefix_ + ".play", playState (), father);
     fsm_.addState (prefix_ + ".input", inputState (), prefix_ + ".play");
     fsm_.addState (prefix_ + ".die", dieState (), father);
     fsm_.addState (prefix_ + ".unload", unloadState (next), father);
     return father + ".load";
 }
Ejemplo n.º 4
0
		//public delegate string NextState();

		static public StateWithEventMap Create(TaskFactory creater, FSM fsm, StateWithEventMap.StateAction nextState){
			string over = "over" + index_.ToString();
			index_++;
			StateWithEventMap state = new StateWithEventMap ();
			Task task = null;
			state.onStart += delegate {
				task = creater();
				TaskManager.PushBack (task, delegate {
					fsm.post(over);
				});
				TaskManager.Run (task);
			};
			state.onOver += delegate {
				task.isOver = delegate{
					return true;
				};
			};
			state.addAction (over, nextState);
			return state;
		}
Ejemplo n.º 5
0
        //public delegate string NextState();

        static public State Create(TaskFactory creater, FSM fsm, State.StateAction nextState)
        {
            string over = "over" + index_.ToString();

            index_++;
            State state = new State();
            Task  task  = null;

            state.onStart += delegate {
                task = creater();
                TaskManager.PushBack(task, delegate {
                    fsm.post(over);
                });
                TaskManager.Run(task);
            };
            state.onOver += delegate {
                task.isOver = delegate {
                    return(true);
                };
            };
            state.addAction(over, nextState);
            return(state);
        }
Ejemplo n.º 6
0
		static public StateWithEventMap Create(TaskFactory creater, FSM fsm, string nextState){
			return Create (creater, fsm, delegate {
				return nextState;
			});
		}
Ejemplo n.º 7
0
 static public State Create(TaskFactory creater, FSM fsm, string nextState)
 {
     return(Create(creater, fsm, delegate {
         return nextState;
     }));
 }