no message
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package Common;
|
||||
import Common.Database.Objects.iDBObject;
|
||||
import Common.Utils.TextLog;
|
||||
import Common_old.Current;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
public interface CurrentAnchestor {
|
||||
//-
|
||||
default String getDescription(){
|
||||
return "?";
|
||||
}
|
||||
LinkedHashMap<CurrentAnchestor, Object> objects = new LinkedHashMap<>();
|
||||
static Object get(CurrentAnchestor name) {
|
||||
if (!objects.containsKey(name))
|
||||
@@ -17,14 +19,14 @@ public interface CurrentAnchestor {
|
||||
else objects.put(name, object);
|
||||
return object;
|
||||
}
|
||||
default String getDescription(){
|
||||
return "?";
|
||||
}
|
||||
static boolean Check(TextLog Log, CurrentAnchestor... names) {
|
||||
for (CurrentAnchestor name : names)
|
||||
if (CurrentAnchestor.get(name) == null)
|
||||
Log.Writeln_(name.getDescription() + " не выбран(а)");
|
||||
return Log.isEmpty();
|
||||
}
|
||||
|
||||
//применять только для наследников iDBObject
|
||||
static boolean matchCurrentID(CurrentAnchestor name, int id) {
|
||||
return (CurrentAnchestor.get(name) != null) && (((iDBObject) CurrentAnchestor.get(name)).id == id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user