Exemplo n.º 1
0
        //Create Characters Implementation
        /// <summary>
        /// Implements create character by calling the forms save character
        /// </summary>
        /// <param name="name"></param>
        /// <param name="stats"></param>
        /// <param name="skills"></param>
        /// <param name="atts"></param>
        public void saveCharacter(string name, Dictionary <String, Double> stats, Dictionary <String, Double> skills,
                                  Dictionary <String, Double> atts)
        {
            object[] data = CharacterData.createSavingData(name, stats, skills, atts);


            myForm.SaveCharacterToFile((XmlNode)data[0], (String)data[1], (XmlDocument)data[2]);
            myForm.Close();
        }
        /// <summary>
        /// Call create character form as dialog, then saves character to a file
        /// </summary>
        void createCharacter()
        {
            CreateCharacterForm form = new CreateCharacterForm();

            form.asDialog = true;
            form.ShowDialog((Form)this.myView);

            if (form.character != null)
            {
                object[] obj = CharacterData.createXmlSavingObjects(form.character);
                form.SaveCharacterToFile((XmlNode)obj[0], (String)obj[1], (XmlDocument)obj[2]);
            }

            //myCreateCharacterFormController = new GraphicCreateCharacterController();
            //Register as observer of child controllers
            //((IDisputeObservable)myCreateCharacterFormController).registerObserver(this);
            //this.stop();
            //((IDisputeFormController)myCreateCharacterFormController).start();
        }