public ILevelBuilder SetContent(Setup.LevelInfoHolder info) { var roads = ReadRoad(info.data.SkipWhile(line => line != "---").Skip(1)); var es = ReadEnemies(info.data.TakeWhile(line => line != "---")); var enemiesIter = es.GetEnumerator(); var roadsToStartsIter = roads.GetEnumerator(); while (enemiesIter.MoveNext() && roadsToStartsIter.MoveNext()) { SetEnemyGroup(ParseEnemies(enemiesIter.Current, info.tier)); SetStrategyForCurrentEnemies( roadsToStartsIter.Current.Key, roadsToStartsIter.Current.Value, 5); } foreach (var leftEnemy in enemies) { leftEnemy.SetDefaultMoveStrategy(); } enemiesWithSetStrategies.AddRange(enemies); enemies.Clear(); enemiesWithSetStrategies.ForEach(s => lvl.AppendEnemy(s)); SetDropForLevel(info.tier, info.difficulty); lvl.AdjustToDifficulty(info.difficulty); return(this); }
private void SetTierFinishLevel(Setup.LevelInfoHolder info, ILevelBuilder builder) { builder .SetPlayer(player) .SetDescription("Tier finish level") .SetFinishedAction(TierFinishedAction) .SetContent(info); level = builder.Build(); }
private void PrepareNextLevel(Setup.LevelInfoHolder info) { //player stuck if (info == null) { FinishTierLevel(); return; } playerStar = info.id; LoadNextLevel(info); }
private void LoadNextLevel(Setup.LevelInfoHolder info) { ILevelBuilder builder = null; if (info.type == LevelType.Classic) { string pathing = System.IO.Directory.GetCurrentDirectory(); var lvlInfo = Setup.LevelReader.ReadLevel(pathing + @"\LevelFile.txt", info.type); lvlInfo.id = info.id; lvlInfo.tier = info.tier; lvlInfo.type = info.type; lvlInfo.difficulty = info.difficulty; builder = new ClassicLevelBuilder(); SetLevel(lvlInfo, builder); } else if (info.type == LevelType.Event) { string pathing = System.IO.Directory.GetCurrentDirectory(); builder = new Event.EventLevelBuilder(); var lvlInfo = Setup.LevelReader.ReadLevel(pathing + @"\LevelFile.txt", info.type); lvlInfo.id = info.id; SetLevel(lvlInfo, builder); } else { if (info.type == LevelType.Meteor) { builder = new Meteor.MeteorLevelBuilder(); } else if (info.type == LevelType.Shop) { builder = new GroceryLevelBuilder(); } else if (info.type == LevelType.Boss) { builder = new BossLevelBuilder(); } SetLevel(info, builder); } level.Begin(); }
public ILevelBuilder SetContent(Setup.LevelInfoHolder info) { shopsView = new EquipmentView(); shopsView.SetForAllItems(GetRandomStuff(info.tier), VALUES.WIDTH / 2); return(this); }
public ILevelBuilder SetContent(Setup.LevelInfoHolder info) { SetDropForLevel(info.tier, info.difficulty); this.level.AdjustToDifficulty(info.difficulty); return(this); }
public ILevelBuilder SetContent(Setup.LevelInfoHolder info) { this.events = GenerateEventScenario(info.data); return(this); }