public void btnCancel_Click(object sender, EventArgs e) { entityData = null; this.FormClosing -= FormEntityData_Closing; this.Close(); }
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; }
public Entity(EntityData entityData) { entityType = entityData.EntityName; Strength = entityData.Strength; Cunning = entityData.Cunning; Constitution = entityData.Constitution; Willpower = entityData.Willpower; Magic = entityData.Magic; Dexterity = entityData.Dexterity; health = new AttributePair(0); mana = new AttributePair(0); stamina = new AttributePair(0); }
public object Clone() { EntityData data = new EntityData(); data.EntityName = this.EntityName; data.Strength = this.Strength; data.Dexterity = this.Dexterity; data.Cunning = this.Cunning; data.Willpower = this.Willpower; data.Magic = this.Magic; data.Constitution = this.Constitution; data.HealthFormula = this.HealthFormula; data.StaminaFormula = this.StaminaFormula; data.MagicFormula = this.MagicFormula; return data; }
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; }
public object Clone() { EntityData entityData = new EntityData(); entityData.EntityName = EntityName; entityData.Strength = Strength; entityData.Dexterity = Dexterity; entityData.Cunning = Cunning; entityData.Willpower = Willpower; entityData.Magic = Magic; entityData.Constitution = Constitution; entityData.HealthFormula = HealthFormula; entityData.StaminaFormula = StaminaFormula; entityData.MagicFormula = MagicFormula; return entityData; }
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); }
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; Cunning = entityData.Cunning; Willpower = entityData.Willpower; Magic = entityData.Magic; Constitution = entityData.Constitution; health = new AttributePair(0); stamina = new AttributePair(0); mana = new AttributePair(0); }
public void btnOK_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbName.Text) || string.IsNullOrEmpty(tbHealthFormula.Text) || string.IsNullOrEmpty(tbStaminaFormula.Text) || string.IsNullOrEmpty(tbManaFormula.Text)) { MessageBox.Show("Name, Health Formula, Stamina Formula and Mana Formula must have values", "Empty Fields"); return; } int str = 0; int dex = 0; int cun = 0; int will = 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 will)) { 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, will, con, mag, tbHealthFormula.Text, tbStaminaFormula.Text, tbManaFormula.Text); this.FormClosing -= FormEntityData_Closing; this.Close(); }
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); }