рефакторинг. вынес в обобщенную часть бд, но еще не все
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Database.Database;
|
||||
import _VisualDVM.Global;
|
||||
import Common.Utils.CommonUtils;
|
||||
import GlobalData.Compiler.Compiler;
|
||||
import GlobalData.Compiler.CompilerType;
|
||||
import GlobalData.GlobalDatabase;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.Machine.MachineType;
|
||||
import GlobalData.User.User;
|
||||
@@ -13,12 +14,12 @@ public class AddMachine extends AddObjectPass<Machine> {
|
||||
}
|
||||
@Override
|
||||
protected Database getDb() {
|
||||
return Global.db;
|
||||
return CommonUtils.db;
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (super.canStart(args)) {
|
||||
if (target.type.equals(MachineType.Local) && Global.db.machines.LocalMachineExists()) {
|
||||
if (target.type.equals(MachineType.Local) && ((GlobalDatabase)CommonUtils.db).machines.LocalMachineExists()) {
|
||||
Log.Writeln_("Локальная машина уже добавлена.");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user