Exemple #1
0
 public void BattleCry(Character character)
 {
     listBox1.Items.Add("My name is " + character.Name);
     listBox1.Items.Add(character.declaim);
     listBox1.Items.Add(character.weapon.UseWeapon());
     listBox1.Items.Add("");
 }
        // Adds a character to the characters list
        public void AddCharacter(Character character)
        {
            if (character == null)
                throw new ArgumentNullException("Character passed to GameManager.AddCharacter was NULL");

            characters.Add(character);
        }
Exemple #3
0
 //method to add players accepts a charater and reeturns a dictionary of update players,
 public Dictionary<String, Character> AddCharater(Character characterToAdd)
 {
     //check is name already exists if it does return default dictionary
     if (gameCharaterDic.ContainsKey(characterToAdd.characterName))
     {
         return gameCharaterDic;
     }
     else
     {
         //else add the the new player and return the update dictionary
         gameCharaterDic.Add(characterToAdd.characterName, characterToAdd);
         return gameCharaterDic;
     }
 }
 public void AddCharacter(Character character)
 {
     CharacterList.Add(character);
 }
 private void printCharacterToListbox(Character character)
 {
     listBox.Items.Add(character.IntroductionMessage);
     listBox.Items.Add(character.SayHi());
     listBox.Items.Add(character.UseWeapon());
 }