Esempio n. 1
0
        void btnCancel_Click(object sender, EventArgs e)
        {
            entityData = null;

            this.FormClosing -= FormEntityData_FormClosing;
            this.Close();
        }
Esempio n. 2
0
 public Entity(string name, EntityData entityData, EntityGender gender, EntityType type)
     : this()
 {
     EntityName = name;
     Gender = gender;
     EntityType = type;
     EntityClass = entityData.EntityName;
     Strength = entityData.Strength;
     Dexterity = entityData.Dexterity;
     Cunning = entityData.Cunning;
     Willpower = entityData.Willpower;
     Magic = entityData.Magic;
     Constitution = entityData.Constitution;
 }
Esempio n. 3
0
        public object Clone()
        {
            EntityData data = new EntityData();

            data.EntityName = EntityName;
            data.Strength = Strength;
            data.Dexterity = Dexterity;
            data.Cunning = Cunning;
            data.Willpower = Willpower;
            data.Magic = Magic;
            data.Constitution = Constitution;
            data.HealthFormula = HealthFormula;
            data.StaminaFormula = StaminaFormula;
            data.MagicFormula = MagicFormula;

            return data;
        }
Esempio n. 4
0
        public object Clone()
        {
            EntityData data = new EntityData();

            data.EntityName = this.EntityName;
            data.Strength = this.Strength;
            data.Dexterity = this.Dexterity;
            data.Intelligence = this.Intelligence;
            data.Agility = this.Agility;
            data.Wisdom = this.Wisdom;
            data.Vitality = this.Vitality;
            data.HealthFormula = this.HealthFormula;
            data.StaminaFormula = this.StaminaFormula;
            data.ManaFormula = this.ManaFormula;

            return data;
        }
Esempio n. 5
0
        public Entity(string name, EntityData entityData, EntityGender gender, EntityType entityType)
            : this()
        {
            EntityName = name;
            EntityClass = entityData.EntityName;
            Gender = gender;
            EntityType = entityType;
            Strength = entityData.Strength;
            Dexterity = entityData.Dexterity;
            Intelligence = entityData.Intelligence;
            Agility = entityData.Agility;
            Wisdom = entityData.Wisdom;
            vitality = entityData.Vitality;

            health = new AttributePair(0);
            stamina = new AttributePair(0);
            mana = new AttributePair(0);
        }
Esempio n. 6
0
        private void AddEntity(EntityData entityData)
        {
            if (FormDetails.EntityDataManager.EntityData.ContainsKey(entityData.EntityName))
            {
                DialogResult result = MessageBox.Show(
                    entityData.EntityName + " already exists.  Do you want to overwrite it?",
                    "Existing Character Class",
                    MessageBoxButtons.YesNo);

                if (result == DialogResult.No)
                    return;

                FormDetails.EntityDataManager.EntityData[entityData.EntityName] = entityData;

                FillListBox();
                return;
            }

            lbDetails.Items.Add(entityData.ToString());

            FormDetails.EntityDataManager.EntityData.Add(entityData.EntityName, entityData);
        }
Esempio n. 7
0
        void btnOK_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbName.Text) || string.IsNullOrEmpty(tbHealth.Text) ||
                string.IsNullOrEmpty(tbStamina.Text) || string.IsNullOrEmpty(tbMana.Text))
            {
                MessageBox.Show("Name, Health Formula, Stamina Formula, and Mana Formula must not be blank");
                return;
            }

            int str = 0;
            int dex = 0;
            int inte = 0;
            int agi = 0;
            int wis = 0;
            int vit = 0;

            if (!int.TryParse(mtbStrength.Text, out str))
            {
                MessageBox.Show("Strength must not be blank");
                return;
            }

            if (!int.TryParse(mtbDexterity.Text, out dex))
            {
                MessageBox.Show("Dexterity must not be blank");
                return;
            }

            if (!int.TryParse(mtbIntelligence.Text, out inte))
            {
                MessageBox.Show("Intelligence must not be blank");
                return;
            }

            if (!int.TryParse(mtbAgility.Text, out agi))
            {
                MessageBox.Show("Agility must not be blank");
                return;
            }

            if (!int.TryParse(mtbWisdom.Text, out wis))
            {
                MessageBox.Show("Wisdom must not be blank");
                return;
            }

            if (!int.TryParse(mtbVitality.Text, out vit))
            {
                MessageBox.Show("Vitality must not be blank");
                return;
            }

            entityData = new EntityData(
                tbName.Text,
                str,
                dex,
                inte,
                agi,
                wis,
                vit,
                tbHealth.Text,
                tbStamina.Text,
                tbMana.Text);

            this.FormClosing -= FormEntityData_FormClosing;
            this.Close();
        }
Esempio n. 8
0
        void btnOK_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbName.Text) || string.IsNullOrEmpty(tbHealth.Text) ||
                string.IsNullOrEmpty(tbStamina.Text) || string.IsNullOrEmpty(tbMana.Text))
            {
                MessageBox.Show("Name, Health Formula, Stamina Formula and Mana Formula must have values.");
                return;
            }

            int str = 0;
            int dex = 0;
            int cun = 0;
            int wil = 0;
            int mag = 0;
            int con = 0;

            if (!int.TryParse(mtbStrength.Text, out str))
            {
                MessageBox.Show("Strength must be numeric.");
                return;
            }

            if (!int.TryParse(mtbDexterity.Text, out dex))
            {
                MessageBox.Show("Dexterity must be numeric.");
                return;
            }

            if (!int.TryParse(mtbCunning.Text, out cun))
            {
                MessageBox.Show("Cunning must be numeric.");
                return;
            }

            if (!int.TryParse(mtbWillpower.Text, out wil))
            {
                MessageBox.Show("Willpower must be numeric.");
                return;
            }

            if (!int.TryParse(mtbMagic.Text, out mag))
            {
                MessageBox.Show("Magic must be numeric.");
                return;
            }

            if (!int.TryParse(mtbConstitution.Text, out con))
            {
                MessageBox.Show("Constitution must be numeric.");
                return;
            }

            entityData = new EntityData(
                tbName.Text,
                str,
                dex,
                cun,
                wil,
                mag,
                con,
                tbHealth.Text,
                tbStamina.Text,
                tbHealth.Text);

            this.FormClosing -= FormEntityData_FormClosing;
            this.Close();
        }
Esempio n. 9
0
 void btnCancel_Click(object sender, EventArgs e)
 {
     entityData = null;
     this.Close();
 }