コード例 #1
0
        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));
                    }
                }
            }
        }
コード例 #2
0
        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));
                    }
                }
            }
        }
コード例 #3
0
 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);
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: laazer/cs_megaman
 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);
 }
コード例 #5
0
ファイル: ScreenLayer.cs プロジェクト: laazer/cs_megaman
        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.");
                    }
                }
            }
        }
コード例 #6
0
        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.");
                    }
                }
            }
        }
コード例 #7
0
 public StageFactory(IEntityPool entityPool, IEntityRespawnTracker respawnTracker)
 {
     _entityPool     = entityPool;
     _respawnTracker = respawnTracker;
 }
コード例 #8
0
ファイル: StageFactory.cs プロジェクト: laazer/cs_megaman
 public StageFactory(IEntityPool entityPool, IEntityRespawnTracker respawnTracker)
 {
     _entityPool = entityPool;
     _respawnTracker = respawnTracker;
 }