/// <summary>
 /// Adds a monster to the list of monsters.
 /// </summary>
 /// <param name="monster"></param>
 public void AddMonster(Character monster)
 {
     if (monster.TypeOfCharacter == CharacterType.Monster)
     {
         this.Monsters.Add(monster.DataContractSerialization());
     }
 }
 /// <summary>
 /// Adds a character to the list of characters.
 /// </summary>
 /// <param name="character">The character to add.</param>
 public void AddCharacter(Character character)
 {
     if (character.TypeOfCharacter == CharacterType.Character)
     {
         this.Characters.Add(character.DataContractSerialization());
     }
 }
        public void AddMonster()
        {
            Character character = new Character();
            character.Name = "Place Holder";
            character.TypeOfCharacter = CharacterType.Character;

            this.Monsters.Add(character);
            WindowServices.DataLayer.Characters.AddObject(character);
            this.DataGridMonsters.Refresh();

            DataGridRow row = this.DataGridMonsters.GetRow(character);

            if (row != null)
            {
                DataGridCell cell = this.DataGridMonsters.GetCell(row, 0);

                // Put focus on this cell and begin editing.
                cell.Focus();
                this.DataGridMonsters.BeginEdit();
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Create a new Character object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="holdingInitiative">Initial value of the HoldingInitiative property.</param>
 /// <param name="typeOfCharacter">Initial value of the TypeOfCharacter property.</param>
 public static Character CreateCharacter(global::System.Int32 id, global::System.String name, global::System.Boolean holdingInitiative, CharacterType typeOfCharacter)
 {
     Character character = new Character();
     character.ID = id;
     character.Name = name;
     character.HoldingInitiative = holdingInitiative;
     character.TypeOfCharacter = typeOfCharacter;
     return character;
 }
Esempio n. 5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Characters EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCharacters(Character character)
 {
     base.AddObject("Characters", character);
 }
 /// <summary>
 /// Adds a monster to the list of monsters.
 /// </summary>
 /// <param name="monster"></param>
 public void AddMonster(Character monster, int quantity)
 {
     if (monster.TypeOfCharacter == CharacterType.Monster)
     {
         for (int i = 0; i < quantity; i++)
         {
             this.Monsters.Add(monster.DataContractSerialization());
         }
     }
 }