Example #1
0
 public void doMove(Vector3 position)
 {
     FSMEvent evt = new FSMEvent ();
     evt.obj = _view._play.inCamera (position + this._dirver.position);
     evt.msg = "move";
     this.fsm_.postEvent (evt);
 }
		public override string postEvent(FSMEvent evt){
			string ret = "";
			if(actionMap_.ContainsKey(evt.msg)){
				ret = actionMap_[evt.msg](evt);
			}
			return ret;			

		}
Example #3
0
        public override string postEvent(FSMEvent evt)
        {
            string ret = "";

            if (actionMap_.ContainsKey(evt.msg))
            {
                ret = actionMap_[evt.msg](evt);
            }
            return(ret);
        }
Example #4
0
File: FSM.cs Project: baby2nana/DRY
        public void post(string msg)
        {
            Debug.Log("msg is..." + msg);
            //FSMEvent evt = new FSMEvent(msg);
            FSMEvent evt = new FSMEvent();

            evt.msg = msg;

            this.postEvent(evt);
        }
Example #5
0
 public void postEvent(FSMEvent evt)
 {
     for(int i =0; i< this.currState_.Count; ++i){
         State state = this.currState_[i] as State;
         string stateName = state.postEvent(evt) as string;
         if(stateName != ""){
             this.translation(stateName);
             break;
         }
     }
 }
Example #6
0
 public void postEvent(FSMEvent evt)
 {
     for (int i = 0; i < this.currState_.Count; ++i)
     {
         State  state     = this.currState_[i] as State;
         string stateName = state.postEvent(evt) as string;
         if (stateName != "")
         {
             this.translation(stateName);
             break;
         }
     }
 }
Example #7
0
File: FSM.cs Project: baby2nana/DRY
        private void postEvent(FSMEvent evt)
        {
            for (int i = 0; i < this.currStates_.Count; i++)
            {
                StateBase state = this.currStates_[i];

                if (debug_)
                {
                    Debug.Log("msg_post" + evt.msg + "state_name" + state.name);
                }

                string stateName = state.postEvent(evt) as string;

                if (stateName != "")
                {
                    this.translation(stateName);
                    break;
                }
            }
        }
Example #8
0
		public void postEvent(FSMEvent evt){

			string outs = "";
			for(int i = 0; i < currState_.Count; ++i){
				outs+= ":" + currState_[i].name;
			}
			
//			Debug.LogWarning (outs);


			for(int i =0; i< this.currState_.Count; ++i){
				State state = this.currState_[i] as State;
				if (debug_) {
					Debug.Log ("msg_post" + evt.msg+ state.name);			
				}
				string stateName = state.postEvent(evt) as string;
				if(stateName != ""){
					this.translation(stateName);
					break;
				}
			}
		}
Example #9
0
 public void post(string msg)
 {
     FSMEvent evt = new FSMEvent();
     evt.msg = msg;
     this.postEvent(evt);
 }
Example #10
0
 public virtual string postEvent(FSMEvent evt)
 {
     return("");
 }
Example #11
0
File: FSM.cs Project: gdgeek/fly
        public void postEvent(FSMEvent evt)
        {
            string outs = "";
            for(int i = 0; i < currState_.Count; ++i){
                outs+= ":" + currState_[i].name;
            }

            Debug.LogWarning (outs);

            for(int i =0; i< this.currState_.Count; ++i){
                State state = this.currState_[i] as State;
                if (debug_) {
                    Debug.Log ("msg_post" + evt.msg+ state.name);
                }
                string stateName = state.postEvent(evt) as string;
                if(stateName != ""){
                    this.translation(stateName);
                    break;
                }
            }
        }
Example #12
0
 public void post(FSMEvent evt)
 {
     postEvent(evt);
 }
Example #13
0
File: FSM.cs Project: baby2nana/DRY
        public void post(string msg, object obj)
        {
            FSMEvent evt = new FSMEvent(msg, obj);

            this.postEvent(evt);
        }
Example #14
0
		public void post(string msg){
			FSMEvent evt = new FSMEvent();

			evt.msg = msg;
			this.postEvent(evt);
		}
Example #15
0
File: FSM.cs Project: baby2nana/DRY
 public void post(FSMEvent evt)
 {
     this.postEvent(evt);
 }
Example #16
0
 public virtual string postEvent(FSMEvent evt)
 {
     return "";
 }
Example #17
0
 public override string postEvent(FSMEvent evt)
 {
     Debug.Log("###" + evt.msg);
     return "";
 }