use of eidolons.game.core.state.DC_GameState in project Eidolons by IDemiurge.
the class DC_Game method reinit.
public void reinit(boolean restart) {
master = new DC_GameMaster(this);
List<Obj> cachedObjects = new ArrayList<>();
if (!restart)
for (Obj sub : getState().getObjects().values()) {
if (sub == null)
continue;
if (sub instanceof Unit)
continue;
if (sub.getRef() == null)
continue;
if (sub.getRef().getSourceObj() == null)
continue;
if (sub.getRef().getSourceObj().isMine()) {
cachedObjects.add(sub);
}
}
this.setState(new DC_GameState(this));
this.setManager(new DC_GameManager(this.getState(), this));
this.getManager().init();
for (Obj sub : cachedObjects) {
getState().addObject(sub);
}
visionMaster.reinit();
}
Aggregations