рефакторинг. переносил текущие объекты в другое место

This commit is contained in:
2024-10-13 22:08:13 +03:00
parent 09b64218bd
commit 6afa2dc892
240 changed files with 1472 additions and 1518 deletions

View File

@@ -7,26 +7,4 @@ public interface Current_ {
default String getDescription(){
return "?";
}
LinkedHashMap<Current_, Object> objects = new LinkedHashMap<>();
static Object get(Current_ name) {
if (!objects.containsKey(name))
objects.put(name,null);
return objects.get(name);
}
static Object set(Current_ name, Object object) {
if (objects.containsKey(name))
objects.replace(name, object);
else objects.put(name, object);
return object;
}
static boolean Check(TextLog Log, Current_... names) {
for (Current_ name : names)
if (Current_.get(name) == null)
Log.Writeln_(name.getDescription() + " не выбран(а)");
return Log.isEmpty();
}
//применять только для наследников iDBObject
static boolean matchCurrentID(Current_ name, int id) {
return (Current_.get(name) != null) && (((iDBObject) Current_.get(name)).id == id);
}
}