Пример #1
0
 public UnitEditor getEditorForUnit(ConstructionUnit unit) {
   checkState();
   for (UnitEditor editor : editors) {
     if (editor.canEdit(unit)) {
       editor.editUnit(unit);
       return editor;
     }
   }
   return null;
 }
Пример #2
0
 public UnitEditor getEditorForUnitType(ConstructionUnitType type) {
   checkState();
   for (UnitEditor editor : editors) {
     if (editor.canEdit(type)) {
       editor.clearUnit();
       editor.createUnit(type);
       return editor;
     }
   }
   return null;
 }