public void Equip(Monster Monster, int slot) { monster = Monster; Slot = slot; //get string of the name of the item string name = string.Concat(itemName.Where(c => !char.IsWhiteSpace(c))); //convert string to a delegate to call the method of the name of the ability equipMethod = DelegateCreation(this, name); if (Slot == 1) { monster.info.equip1 = this; } else if (Slot == 2) { monster.info.equip2 = this; } isEquipped = true; //SetInventorySlot(inventorySlot); equipMethod.Invoke(); //refresh the monster's list of stat modifiers monster.MonsterStatMods(); }
public whatif_equipment() { PAGENAME = "whatif_equipment.aspx"; featureHelper = new EquipmentDelegate(); fieldsNonEditable = new bool[featureHelper.FIELDS.Length]; fieldsNonEditable[1] = true; }
public EquipEffect(Monster Monster, EquipmentScript Equipment, int slot) { monster = Monster; equipment = Equipment; Slot = slot; equipment.UnEquip(); //get string of the name of the item string name = string.Concat(equipment.itemName.Where(c => !char.IsWhiteSpace(c))); //convert string to a delegate to call the method of the name of the ability equipMethod = DelegateCreation(this, name); //call the method that lines up with the name of the item equipMethod.Invoke(); //refresh the monster's list of stat modifiers monster.MonsterStatMods(); }
public equipment() { PAGENAME = "/input/equipment/table.aspx"; featureHelper = new EquipmentDelegate(); }
//create the method delegate for each item EquipmentDelegate DelegateCreation(object target, string functionName) { EquipmentDelegate eq = (EquipmentDelegate)Delegate.CreateDelegate(typeof(EquipmentDelegate), target, functionName); return(eq); }