Enable closing map
This commit is contained in:
@@ -24,6 +24,8 @@ public interface Context extends Updatable, Renderable, Disposable {
|
|||||||
|
|
||||||
void openMap(String mapUid);
|
void openMap(String mapUid);
|
||||||
|
|
||||||
|
void closeMap();
|
||||||
|
|
||||||
Entity createEntity(String entitySetUid);
|
Entity createEntity(String entitySetUid);
|
||||||
|
|
||||||
Image getImage(String imageUid);
|
Image getImage(String imageUid);
|
||||||
|
|||||||
@@ -88,12 +88,20 @@ public class DefaultContext implements Context {
|
|||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Override
|
@Override
|
||||||
public void openMap(@NonNull String mapUid) {
|
public void openMap(@NonNull String mapUid) {
|
||||||
|
log.info("Opening map with UID: [{}]", mapUid);
|
||||||
map = mapManager.loadObject(mapUid);
|
map = mapManager.loadObject(mapUid);
|
||||||
mapHandler = mapManager.loadHandler(this, mapUid);
|
mapHandler = mapManager.loadHandler(this, mapUid);
|
||||||
|
|
||||||
mapHandler.onOpen(this, map);
|
mapHandler.onOpen(this, map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void closeMap() {
|
||||||
|
log.info("Closing map");
|
||||||
|
map = null;
|
||||||
|
mapHandler = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Entity createEntity(@NonNull String entitySetUid) {
|
public Entity createEntity(@NonNull String entitySetUid) {
|
||||||
log.info("Creating new entity with UID: [{}]", entitySetUid);
|
log.info("Creating new entity with UID: [{}]", entitySetUid);
|
||||||
|
|||||||
Reference in New Issue
Block a user