public ScreenLayer(ScreenLayerInfo info, StageHandler stage, IEntityRespawnTracker respawnTracker) { this._info = info; this._stage = stage; this._respawnTracker = respawnTracker; this._squares = new MapSquare[info.Tiles.Height][]; for (int y = 0; y < info.Tiles.Height; y++) { this._squares[y] = new MapSquare[info.Tiles.Width]; for (int x = 0; x < info.Tiles.Width; x++) { try { Tile tile = info.Tiles.TileAt(x, y); if (tile == null) { throw new Exception(); } this._squares[y][x] = new MapSquare(this, tile, x, y, info.Tiles.Tileset.TileSize); } catch { throw new GameRunException(string.Format("There's an error in stage {0}, screen file {1}.scn.\nThere's a unrecognized tile number somewhere.", stage.Info.Name, info.Name)); } } } }
public ScreenLayer(ScreenLayerInfo info, StageHandler stage, IEntityRespawnTracker respawnTracker) { this._info = info; this._stage = stage; this._respawnTracker = respawnTracker; this._squares = new MapSquare[info.Tiles.Height][]; for (int y = 0; y < info.Tiles.Height; y++) { this._squares[y] = new MapSquare[info.Tiles.Width]; for (int x = 0; x < info.Tiles.Width; x++) { try { Tile tile = info.Tiles.TileAt(x, y); if (tile == null) throw new Exception(); this._squares[y][x] = new MapSquare(this, tile, x, y, info.Tiles.Tileset.TileSize); } catch { throw new GameRunException(string.Format("There's an error in stage {0}, screen file {1}.scn.\nThere's a unrecognized tile number somewhere.", stage.Info.Name, info.Name)); } } } }
private Game() { _entitySource = new GameEntitySource(); _entityPool = new GameEntityPool(_entitySource); _tileProperties = new GameTilePropertiesSource(); _respawnTracker = new GameEntityRespawnTracker(); stageFactory = new StageFactory(_entityPool, _respawnTracker); _stateMachine = new GameStateMachine(_entityPool, stageFactory); }
public ScreenLayer(ScreenLayerInfo info, StageHandler stage, IEntityRespawnTracker respawnTracker) { this._info = info; this._stage = stage; this._respawnTracker = respawnTracker; this._squares = new MapSquare[info.Tiles.Height][]; for (int y = 0; y < info.Tiles.Height; y++) { this._squares[y] = new MapSquare[info.Tiles.Width]; for (int x = 0; x < info.Tiles.Width; x++) { try { Tile tile = info.Tiles.TileAt(x, y); this._squares[y][x] = new MapSquare(this, tile, x, y, info.Tiles.Tileset.TileSize); } catch { throw new GameRunException("There's an error in screen file " + info.Name + ".scn,\nthere's a bad tile number somewhere."); } } } }
public StageFactory(IEntityPool entityPool, IEntityRespawnTracker respawnTracker) { _entityPool = entityPool; _respawnTracker = respawnTracker; }