no message

This commit is contained in:
2024-10-09 23:37:58 +03:00
parent eb278676cc
commit d1ffab1e70
299 changed files with 1844 additions and 1539 deletions

32
src/Common/Current_.java Normal file
View File

@@ -0,0 +1,32 @@
package Common;
import Common.Database.Objects.iDBObject;
import Common.Utils.TextLog;
import java.util.LinkedHashMap;
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);
}
}