Exemplo n.º 1
0
 public void WriteMagicToDabase(Magic MagicToWrite)
 {
     using (StreamWriter _streamwriter = new StreamWriter(filepath))
     {
         _streamwriter.WriteLine(MagicToWrite.ReturnTextOutput());
     }
 }
Exemplo n.º 2
0
        public void CreateNewDatabase(string DatabaseName)
        {
            using (StreamWriter _streamwriter = new StreamWriter("..\\..\\TestData\\" + DatabaseName + ".TDB"))
            {
                filepath = ((FileStream)(_streamwriter.BaseStream)).Name;

            }
            Magic test = new Magic();
            WriteMagicToDabase(test);
        }
Exemplo n.º 3
0
        private void PrintSpell_Click(object sender, EventArgs e)
        {
            EffectType temp;
            Enum.TryParse<EffectType>(SkillEffectTypecomboBox.SelectedItem.ToString(), out temp);

            Magic spellForOutput = new Magic(name: Nametextbox.Text, cost: (int)CostnumericUpDown.Value,
                accuracy: (int)AccuracynumericUpDown.Value, potency: (int)PotencynumericUpDown.Value,
                spelleffecttype: (EffectType)Enum.Parse(typeof(EffectType),SkillEffectTypecomboBox.SelectedItem.ToString()),
                description: (string)DescriptionrichTextBox.Text,
                spellmagicschooltype: (MagicSchoolType)Enum.Parse(typeof(MagicSchoolType), MagicSchoolcombobox.SelectedItem.ToString()),
                spellelementtype: (ElementType)Enum.Parse(typeof(ElementType), MagicElementcombobox.SelectedItem.ToString())
                );

            OutputBox.Text = spellForOutput.ReturnTextOutput();
        }