예제 #1
0
파일: Command.cs 프로젝트: aisyluG/OOP_labs
 public void execute(MyStorage _storage, int _ind)
 {
     storage = _storage;
     index   = _ind;
     obj     = new CStickyObject(storage.getObject(index));
     storage.deleteObject(index);
     index = storage.setObject(obj);
     Console.WriteLine(index);
 }
예제 #2
0
파일: Form1.cs 프로젝트: aisyluG/OOP_labs
 public void ChangeChoosenObjects(Command doCommand, int MAXx, int MAXy, Stack <Command> history)
 {
     for (int i = 0; i < Count; i++)
     {
         if (arr[i].IsObjectSelected() == true)
         {
             if (arr[i].IsA("CStickyObject") == true)
             {
                 CStickyObject s = (CStickyObject)arr[i];
                 for (int j = 0; j < Count; j++)
                 {
                     if (j != i)
                     {
                         s.roll(arr[j]);
                     }
                 }
             }
             Command newCommand = doCommand.clon();
             newCommand.execute(arr[i], MAXx, MAXy);
             history.Push(newCommand);
         }
     }
     notifyEveryone();
 }
예제 #3
0
파일: Command.cs 프로젝트: aisyluG/OOP_labs
 override public void execute()
 {
     obj = new CStickyObject(storage.getObject(index));
     storage.deleteObject(index);
     index = storage.setObject(obj);
 }
예제 #4
0
파일: CPoint.cs 프로젝트: aisyluG/OOP_labs
 public void onSubjectChanged(CStickyObject point)
 {
     move(point.getDX(), point.getDY());
 }