예제 #1
0
        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);
        }
예제 #2
0
파일: Form1.cs 프로젝트: Tobraef/Lost-Boy
 private void SetTierFinishLevel(Setup.LevelInfoHolder info, ILevelBuilder builder)
 {
     builder
     .SetPlayer(player)
     .SetDescription("Tier finish level")
     .SetFinishedAction(TierFinishedAction)
     .SetContent(info);
     level = builder.Build();
 }
예제 #3
0
파일: Form1.cs 프로젝트: Tobraef/Lost-Boy
 private void PrepareNextLevel(Setup.LevelInfoHolder info)
 {
     //player stuck
     if (info == null)
     {
         FinishTierLevel();
         return;
     }
     playerStar = info.id;
     LoadNextLevel(info);
 }
예제 #4
0
파일: Form1.cs 프로젝트: Tobraef/Lost-Boy
        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();
        }
예제 #5
0
 public ILevelBuilder SetContent(Setup.LevelInfoHolder info)
 {
     shopsView = new EquipmentView();
     shopsView.SetForAllItems(GetRandomStuff(info.tier), VALUES.WIDTH / 2);
     return(this);
 }
예제 #6
0
 public ILevelBuilder SetContent(Setup.LevelInfoHolder info)
 {
     SetDropForLevel(info.tier, info.difficulty);
     this.level.AdjustToDifficulty(info.difficulty);
     return(this);
 }
예제 #7
0
 public ILevelBuilder SetContent(Setup.LevelInfoHolder info)
 {
     this.events = GenerateEventScenario(info.data);
     return(this);
 }