private GameLayerTiled _mainLayer; // Main GameLayer, containing TileSystem and game activity #endregion Fields #region Constructors /// <summary> /// Create a new GameLevel with the specified TileSystem properties /// </summary> /// <param name="numRows">Number of tile rows</param> /// <param name="numCols">Number of tile columns</param> /// <param name="defaultTileReferenceCode">Default tile to populate the level</param> public GameLevel(GameScreen gameScreen, int numRows, int numCols, byte defaultTileReferenceCode) { Construct(gameScreen); NewLevel(numRows, numCols, defaultTileReferenceCode); }
/// <summary> /// Load a GameLevel from a file /// </summary> /// <param name="filename">File to load from</param> public GameLevel(GameScreen gameScreen, string filename) { Construct(gameScreen); LoadLevel(filename); }
/// <summary> /// Common constructor code /// Should be called by all constructors /// </summary> private void Construct(GameScreen gameScreen) { _gameScreen = gameScreen; // Set the game screen to the screen that brought us here _gameLayers = new List<GameLayer>(); // Initialize GameLayers list so we can add to it }