private DungeonLevel LoadLevel(int levelIndex, Point?enterTile) { var nextLevel = Builder.GetLevel(levelIndex, this, enterTile); ActiveLevels.Add(nextLevel); return(nextLevel); }
protected virtual DungeonLevel LoadLevel(int levelIndex, Point?enterTile) { var nextLevel = Builder.GetLevel(Factories, levelIndex, enterTile); ActiveLevels.Add(nextLevel); return(nextLevel); }
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); } }
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(); }
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); } }