Beispiel #1
0
 public void StateTransition(ActionElement act, Config config, States wallStates)
 {
     state.X += act.VX;
     state.Y += act.VY;
     for (int i = 0; i < wallStates.Count; i++)
     {
         if (state.Comparison(wallStates[i].StateChar))
         {
             state.X -= act.VX;
             state.Y -= act.VY;
             return;
         }
     }
     if (state.X > config.CellWidth)
     {
         state.X = config.CellWidth;
     }
     if (state.X < 1)
     {
         state.X = 1;
     }
     if (state.Y > config.CellHeight)
     {
         state.Y = config.CellHeight;
     }
     if (state.Y < 1)
     {
         state.Y = 1;
     }
 }
Beispiel #2
0
 public ActionElement(ActionElement ae = null, int vx = 0, int vy = 0)
 {
     if (ae != null)
     {
         vx      = ae.VX;
         vy      = ae.VY;
         actflag = ae.ActFlag;
     }
     else
     {
         this.vx = vx;
         this.vy = vy;
     }
 }
Beispiel #3
0
 public Action(int vx, int vy)
 {
     action = new ActionElement(null, vx, vy);
     svList = new SVList();
 }