public void AddNew(string name) { HeroData data = (HeroData)_dataService.Get(DataType.Hero, name); Hero hero = new Hero(name); hero.Attributes = Stats.Convert(data.Attributes); foreach (string skillName in data.SkillNames) { hero.Skills.Add((SkillData)_dataService.Get(DataType.Skill, skillName)); }; _heroes.Add(name, hero); }
private void CreateHero(Hero hero) { Entity e = _entityWorld.CreateEntity(); e.AddComponent(new Group(true, hero.Name)); e.AddComponent(new Image(_content.Load<Texture2D>(@"BattleSprite\" + hero.Name), 0)); e.AddComponent(new BattleStats(hero)); e.AddComponent(new Acting()); e.AddComponent(new Transform()); e.AddComponent(new InputControlled()); e.Group = FighterManager.GroupName; e.Refresh(); }