Skip to content
Snippets Groups Projects
Commit a8474414 authored by Filip Dreger's avatar Filip Dreger
Browse files

Fixes

parent a07b49b3
Branches main
No related tags found
No related merge requests found
group 'pl.simmundi.trurl'
version '1.5-SNAPSHOT'
version 'main-SNAPSHOT'
subprojects {
apply plugin: 'java-library'
......
......@@ -17,6 +17,10 @@ public final class Entity {
return session == null ? sessionIndex : session.getId(sessionIndex);
}
int getSessionIndex() {
return sessionIndex;
}
public <T> T get(Class<T> componentClass) {
return session.get(componentClass, sessionIndex);
}
......
......@@ -35,6 +35,15 @@ public class Session {
counter = 0;
}
public <T> T getIfAvailable(int id, ComponentToken<T> token) {
Entity entity = idToEntity.get(id);
if (entity == null) {
return null;
} else {
return (T) components[token.index][entity.getSessionIndex()];
}
}
public void flush() {
flush(daoManager.allTokens());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment