Example #1
0
        private void LoadHero(IReadOnlyList <string> objects)
        {
            var levelManager = new LevelManager(int.Parse(objects[7]), int.Parse(objects[8]));
            var skillManager = new SkillManager((Players)int.Parse(objects[0]), mContent);

            for (var j = 0; j < int.Parse(objects[9]); j++)
            {
                skillManager.AddSkillPoint();
            }

            for (var j = 10; j < objects.Count - 1; j++)
            {
                var skill = objects[j].Split('/');
                skillManager.SetSkillLevel((Skills)int.Parse(skill[0]), int.Parse(skill[1]));
            }

            GameState.Current.AddHero((Players)int.Parse(objects[0]),
                                      new Vector2(float.Parse(objects[2]), float.Parse(objects[3])),
                                      float.Parse(objects[4]),
                                      int.Parse(objects[6]),
                                      int.Parse(objects[5]),
                                      levelManager,
                                      skillManager);
        }