рефакторинг. вынес в обобщенную часть бд, но еще не все

This commit is contained in:
2024-10-08 01:30:25 +03:00
parent d0c08a2c7e
commit 18ceb04325
91 changed files with 442 additions and 456 deletions

View File

@@ -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;
}