Skip to content

Commit

Permalink
Moved level env to level state
Browse files Browse the repository at this point in the history
  • Loading branch information
macbury committed Nov 7, 2014
1 parent af5fc26 commit 2a0d401
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/macbury/forge/level/Level.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Level implements Disposable {
public final LevelEnv env;

public Level(LevelState state) {
this.env = new LevelEnv();
this.env = state.env;
this.state = state;
this.terrainMap = state.terrainMap;
this.renderContext = new RenderContext(new DefaultTextureBinder(DefaultTextureBinder.WEIGHTED, 1));
Expand Down
3 changes: 2 additions & 1 deletion core/src/macbury/forge/level/LevelState.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class LevelState {
private static final String MAP_NAME_PREFIX = "MAP_";
private static int uid = 0;

public LevelEnv env;
public ChunkMap terrainMap;
public int id;
public String name;
Expand All @@ -26,7 +27,7 @@ public static LevelState blank(int width, int height, int depth) {
state.terrainMap = new ChunkMap(ChunkMap.TERRAIN_TILE_SIZE);
state.id = uid();
state.name = MAP_NAME_PREFIX + state.id;

state.env = new LevelEnv();
state.terrainMap.initialize(width,height,depth);
state.terrainMap.buildFloor();
return state;
Expand Down

0 comments on commit 2a0d401

Please sign in to comment.