public void execute(MyStorage _storage) { storage = _storage; Count = storage.getNumSelected(); objects = new CPoint[Count]; int k = 0; for (int i = storage.getCount() - 1; i >= 0; i--) { if (storage.getObject(i).IsObjectSelected() == true) { objects[k] = storage.getObject(i); storage.deleteObject(i); k++; } } }
public void execute(MyStorage _storage, Color _mycolor) { storage = _storage; mycolor = _mycolor; count = storage.getNumSelected(); int k = 0; p = new Color[count]; for (int i = 0; i < storage.getCount(); i++) { if (storage.getObject(i).IsObjectSelected() == true) { p[k] = storage.getObject(i).getColor(); storage.getObject(i).setСolor(mycolor); k++; } } }