/// <summary> /// Takes a skill out of the bar and returns it. /// </summary> /// <param name="slot">The slot to empty.</param> /// <returns></returns> public Skill Remove(int slot) { Skill skill = Skills[slot - 1]; Skills[slot - 1] = new EmptySkill(Self); return(skill); }
public UseSkill GetAvailableSkill(string id) { var aSkill = availableSkills.Where(s => s.ID == id).FirstOrDefault(); if (aSkill == null) { aSkill = new EmptySkill(); } return(aSkill); }
public Skillbar(Actor self) { Self = self; Skill Empty = new EmptySkill(Self); Skills = new List <Skill>(6) { Empty, Empty, Empty, Empty, Empty, Empty }; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); //Bad workaround boxel = new Texture2D(spriteBatch.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); boxel.SetData(new[] { Color.White }); retroFont = Content.Load <SpriteFont>("Font"); EmptySkill.initEmpty(); }
public Skillbar(Actor self, List <Skill> skills) { Self = self; for (int i = 0; i < Skills.Count; i++) { if (skills[i] is null) { Skills[i] = new EmptySkill(self); } else { Skills[i] = skills[i]; Skills[i].SetUser(self); } } }
private void SetSkillToCharacter(GameObject heroCharacter, Characters characters) { ISkillHero skill; switch (characters) { case Characters.Apple: skill = heroCharacter.GetComponent <SkillApple>(); break; case Characters.Banana: skill = heroCharacter.GetComponent <SkillBanana>(); break; case Characters.Carrot: skill = heroCharacter.GetComponent <SkillCarrot>(); break; default: skill = new EmptySkill(); break; } HeroCharacter.Skill = skill; }