Example #1
0
        private DungeonLevel LoadLevel(int levelIndex, Point?enterTile)
        {
            var nextLevel = Builder.GetLevel(levelIndex, this, enterTile);

            ActiveLevels.Add(nextLevel);
            return(nextLevel);
        }
Example #2
0
        protected virtual DungeonLevel LoadLevel(int levelIndex, Point?enterTile)
        {
            var nextLevel = Builder.GetLevel(Factories, levelIndex, enterTile);

            ActiveLevels.Add(nextLevel);
            return(nextLevel);
        }
Example #3
0
        private void Leader_LocationChanged(object sender, EventArgs e)
        {
            if (Time != null)//not on an initialization
            {
                UpdateVisibleTiles();
                SetupLevelConnectors();

                CurrentLevel = ActiveLevels.Single(x => x.LevelIndex == Leader.Location.Tile.LevelIndex);
            }
        }
Example #4
0
        private void ConnectLevels(ILevelConnector e)
        {
            DungeonLevel nextLevel;

            if (!ActiveLevels.Contains(e.NextLevelIndex, out nextLevel))
            {
                nextLevel = LoadLevel(e.NextLevelIndex, e.TargetTilePosition); //load level if necesarry
            }
            e.NextLevelEnter = nextLevel.TilesPositions[e.TargetTilePosition]; //TODO unolad level disconect

            UpdateVisibleTiles();
        }
Example #5
0
        private void CurrentPlayer_LocationChanged(object sender, EventArgs e)
        {
            if (Time != null)//not on an initialization
            {
                UpdateVisibleTiles();

                foreach (var t in currentVisibleTiles)
                {
                    var connector = t as ILevelConnector;
                    if (connector != null)
                    {
                        ConnectLevels(connector);
                    }
                }

                CurrentLevel = ActiveLevels.Single(x => x.LevelIndex == Theron.Location.LevelIndex);
            }
        }