Ejemplo n.º 1
0
        public void CreateCharacter(Character character)
        {
            List<Character> newCharacter = new List<Character>();

            newCharacter.Add(character);
            xmlCharacterTranslator.Serialize(newCharacter);
        }
Ejemplo n.º 2
0
        public GameViewModel()
        {
            DataHandler = new DataHandler();
            Character1 = new Character();
            Character2 = new Character();
            NewCharacter = null;
            CharacterFull = false;

            LoadCharacters();
        }
 public void MakeCharacter2(Character character)
 {
     ImageCharacter2.Source = new BitmapImage(new Uri(character.ImagePath));
     TextBlockNameCharacter2.Text = character.CharacterName;
     TextBlockLevelCharacter2.Text = character.CharacterLevel.ToString();
     TextBlockClassCharacter2.Text = character.CharacterClass.ClassName;
     TextBlockDamageCharacter2.Text = character.Damage.ToString();
     TextBlockToughnessCharacter2.Text = character.Toughness.ToString();
     UpdateView();
 }
        private void ButtonCreate_Click(object sender, RoutedEventArgs e)
        {
            if (TextBoxName.Text.Length > 2)
            {
                Character newCharacter = new Character();
                newCharacter.MakeCharacter();
                newCharacter.CharacterName = TextBoxName.Text;

                if (Archer.IsChecked == true)
                {
                    Archer newClass = new Archer();
                    newClass.MakeClass();
                    newCharacter.AssignClass(newClass);
                    ViewModel.NewCharacter = newCharacter;
                    Close();
                }
                else if (Monk.IsChecked == true)
                {
                    Monk newClass = new Monk();
                    newClass.MakeClass();
                    newCharacter.AssignClass(newClass);
                    ViewModel.NewCharacter = newCharacter;
                    Close();
                }
                else if (Warrior.IsChecked == true)
                {
                    Warrior newClass = new Warrior();
                    newClass.MakeClass();
                    newCharacter.AssignClass(newClass);

                    ViewModel.NewCharacter = newCharacter;
                    Close();
                }
                else if (Wizard.IsChecked == true)
                {
                    Wizard newClass = new Wizard();
                    newClass.MakeClass();
                    newCharacter.AssignClass(newClass);
                    ViewModel.NewCharacter = newCharacter;
                    Close();
                }
                else
                {
                    return;
                }
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 5
0
 public void StartGame(Character character)
 {
 }