Example #1
0
 override public void execute() // отменить передвижение
 {
     if (f != null)
     {
         if (f.canmove(moving, max_w, max_h) == true)
         {
             if (move == 1)
             {
                 f.setMove(3);
                 f.changeLocate("down", max_w, max_h);;
             }
             if (move == 3)
             {
                 f.setMove(1);
                 f.changeLocate("up", max_w, max_h);;
             }
             if (move == 2)
             {
                 f.setMove(4);
                 f.changeLocate("right", max_w, max_h);;
             }
             if (move == 4)
             {
                 f.setMove(2);
                 f.changeLocate("left", max_w, max_h);;
             }
         }
     }
 }
Example #2
0
 override public void execute(Figure f_, int max_w_, int max_h_) // выполнить передвижение
 {
     f     = f_;
     max_w = max_w_;
     max_h = max_h_;
     if (f.canmove(moving, max_w, max_h) == true)
     {
         f.setMove(move);
         f.changeLocate(moving, max_w, max_h);
     }
 }
Example #3
0
 public override void changeLocate(string moving, int max_w, int max_h)
 {
     sticky.changeLocate(moving, max_w, max_h);
     notifyEveryine();
 }