public ExtendedDescription GetExtendedDescription() { ExtendedDescription desc = new ExtendedDescription(); desc.Keyword = txtKeywords.Text; desc.Description = txtDescription.Text; return desc; }
public EditExtendedDescription(ExtendedDescription desc) { InitializeComponent(); lblDescription.Text = "Description"; txtDescription.Text = desc.Description; txtKeywords.Text = desc.Keyword; }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Payer != null) { hashCode = hashCode * 59 + Payer.GetHashCode(); } if (Payee != null) { hashCode = hashCode * 59 + Payee.GetHashCode(); } if (ExtensionUType != null) { hashCode = hashCode * 59 + ExtensionUType.GetHashCode(); } if (ExtendedDescription != null) { hashCode = hashCode * 59 + ExtendedDescription.GetHashCode(); } if (ServiceId != null) { hashCode = hashCode * 59 + ServiceId.GetHashCode(); } return(hashCode); } }
public ExtendedDescription GetExtendedDescription() { ExtendedDescription desc = new ExtendedDescription(); desc.Keyword = txtKeywords.Text; desc.Description = txtDescription.Text; return(desc); }
/// <summary> /// Duplicate an object exactly minus contents. /// </summary> /// <param name="parent"></param> /// <param name="clone"></param> public static void CloneObject(Object parent, ref Object clone) { int i; ExtendedDescription edNew; if (parent == null || clone == null) { return; } // Start fixing the object. clone.Name = parent.Name; clone.ShortDescription = parent.ShortDescription; clone.FullDescription = parent.FullDescription; clone.SpecFun = parent.SpecFun; clone.Affected = parent.Affected; clone.ItemType = parent.ItemType; clone.WearFlags = parent.WearFlags; clone.UseFlags = parent.UseFlags; clone.Material = parent.Material; clone.Size = parent.Size; clone.Volume = parent.Volume; clone.Craftsmanship = parent.Craftsmanship; clone.Weight = parent.Weight; clone.Cost = parent.Cost; clone.Level = parent.Level; clone.Condition = parent.Condition; clone.Timer = parent.Timer; clone.Condition = parent.Condition; clone.Trap = parent.Trap; for (i = 0; i < Limits.NUM_ITEM_EXTRA_VECTORS; i++) { clone.ExtraFlags[i] = parent.ExtraFlags[i]; } for (i = 0; i < Limits.NUM_AFFECT_VECTORS; i++) { clone.AffectedBy[i] = parent.AffectedBy[i]; } for (i = 0; i < 8; i++) { clone.Values[i] = parent.Values[i]; } /* extended desc */ foreach (ExtendedDescription ed in parent.ExtraDescription) { edNew = new ExtendedDescription(); edNew.Keyword = ed.Keyword; edNew.Description = ed.Description; clone.ExtraDescription.Add(edNew); } }
private void btnEditExtraDescr_Click(object sender, EventArgs e) { int index = lstExtraDesc.SelectedIndex; if (index != -1) { ExtendedDescription desc = lstExtraDesc.SelectedItem as ExtendedDescription; EditExtendedDescription dialog = new EditExtendedDescription(desc); if (dialog.ShowDialog() == DialogResult.OK) { lstExtraDesc.Items.RemoveAt(index); lstExtraDesc.Items.Insert(index, dialog.GetExtendedDescription()); } } }
/// <summary> /// Returns true if BankingTransactionDetailExtendedData instances are equal /// </summary> /// <param name="other">Instance of BankingTransactionDetailExtendedData to be compared</param> /// <returns>Boolean</returns> public bool Equals(BankingTransactionDetailExtendedData other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Payer == other.Payer || Payer != null && Payer.Equals(other.Payer) ) && ( Payee == other.Payee || Payee != null && Payee.Equals(other.Payee) ) && ( ExtensionUType == other.ExtensionUType || ExtensionUType != null && ExtensionUType.Equals(other.ExtensionUType) ) && ( ExtendedDescription == other.ExtendedDescription || ExtendedDescription != null && ExtendedDescription.Equals(other.ExtendedDescription) ) && ( ServiceId == other.ServiceId || ServiceId != null && ServiceId.Equals(other.ServiceId) )); }
/// <summary> /// Immortal command to change object values and properties. /// </summary> /// <param name="ch"></param> /// <param name="str"></param> public static void SetObject(CharData ch, string[] str) { if( ch == null ) return; Object obj; int value; ch.GetChar(); if (str.Length < 3) { ch.SendText("Syntax: set o <object> <field> <value>\r\n"); ch.SendText("or: set o <object> <string> <value>\r\n"); ch.SendText("\r\n"); ch.SendText("Field being one of:\r\n"); ch.SendText(" value0 value1 value2 value3 value4\r\n"); ch.SendText(" value6 value7 type condition craft\r\n"); ch.SendText(" extra wear level weight cost timer\r\n"); ch.SendText(" aff0 aff1 aff2 aff3 aff4 index_aff\r\n"); ch.SendText("\r\n"); ch.SendText("String being one of:\r\n"); ch.SendText(" name short long ed use spec\r\n"); return; } if (!(obj = Object.GetObjectInWorld(ch, str[0]))) { ch.SendText("Nothing like that in this universe.\r\n"); return; } /* * Snarf the value (which need not be numeric). */ Int32.TryParse(str[2], out value); /* * Set something. */ if (!MUDString.StringsNotEqual(str[1], "value0") || !MUDString.StringsNotEqual(str[1], "v0")) { obj.Values[0] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "value1") || !MUDString.StringsNotEqual(str[1], "v1")) { obj.Values[1] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "value2") || !MUDString.StringsNotEqual(str[1], "v2")) { obj.Values[2] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "value3") || !MUDString.StringsNotEqual(str[1], "v3")) { obj.Values[3] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "value4") || !MUDString.StringsNotEqual(str[1], "v4")) { obj.Values[4] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "value5") || !MUDString.StringsNotEqual(str[1], "v5")) { obj.Values[5] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "value6") || !MUDString.StringsNotEqual(str[1], "v6")) { obj.Values[6] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "value7") || !MUDString.StringsNotEqual(str[1], "v7")) { obj.Values[7] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "aff0") || !MUDString.StringsNotEqual(str[1], "a0")) { obj.AffectedBy[0] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "aff1") || !MUDString.StringsNotEqual(str[1], "a1")) { obj.AffectedBy[1] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "aff2") || !MUDString.StringsNotEqual(str[1], "a2")) { obj.AffectedBy[2] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "aff3") || !MUDString.StringsNotEqual(str[1], "a3")) { obj.AffectedBy[3] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "aff4") || !MUDString.StringsNotEqual(str[1], "a4")) { obj.AffectedBy[4] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "extra")) { if (!MUDString.IsNumber(str[2])) { ch.SendText("Extra value must be a number.\r\n"); return; } obj.ExtraFlags[0] = value; ch.SendText("Extra flag is set.\r\n"); return; } // TODO: FIXME: BUG: Does not work with new code. //if (!MUDString.StringsNotEqual(str[1], "index_aff") || !MUDString.StringsNotEqual(str[1], "ia")) //{ // argument = MUDString.OneArgument(argument, ref str[2]); // argument = MUDString.OneArgument(argument, ref arg4); // if (String.IsNullOrEmpty(str[2]) || String.IsNullOrEmpty(arg4)) // { // ch.SendText("Syntax: set o <object> index_aff <aff_number> <value>\r\n"); // return; // } // if (!MUDString.IsNumber(str[2]) || !MUDString.IsNumber(arg4)) // { // ch.SendText("The index affect and its value must be a number.\r\n"); // return; // } // Affect af; // int val4 = 0; // Affect.Apply affval = Affect.Apply.none; // try // { // affval = (Affect.Apply)Enum.Parse(typeof(Affect.Apply), str[2]); // } // catch (Exception ex) // { // ch.SendText("Invalid affect apply type.\r\n"); // return; // } // Int32.TryParse(arg4, out val4); // af = new Affect(0, 0, 0, -1, affval, val4, Affect.AFFECT_NONE); // obj.AddAffect(af); // ch.SendText("Added index affect.\r\n"); // return; //} if (!MUDString.StringsNotEqual(str[1], "extra")) { if (!MUDString.IsNumber(str[2])) { ch.SendText("Extra value must be a number.\r\n"); return; } obj.ExtraFlags[0] = value; ch.SendText("Extra flag is set.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "extra2")) { if (!MUDString.IsNumber(str[2])) { ch.SendText("Extra value must be a number.\r\n"); return; } obj.ExtraFlags[1] = value; ch.SendText("Extra2 flag is set.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "extra3")) { if (!MUDString.IsNumber(str[2])) { ch.SendText("Extra value must be a number.\r\n"); return; } obj.ExtraFlags[2] = value; ch.SendText("Extra3 flag is set.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "wear")) { obj.WearFlags[0] = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "level")) { obj.Level = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "type")) { try { obj.ItemType = (ObjTemplate.ObjectType)Enum.Parse(typeof(ObjTemplate.ObjectType), str[1], false); ch.SendText("Ok.\r\n"); } catch (Exception) { ch.SendText("Invalid object type."); } return; } if (!MUDString.StringsNotEqual(str[1], "weight")) { if (obj.CarriedBy != null && !obj.CarriedBy.IsNPC()) { ch.SendText("You may not modify an item's weight while on a PC.\r\n"); return; } obj.Weight = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "condition")) { obj.Condition = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "craft")) { try { obj.Craftsmanship = (ObjTemplate.Craftsmanship)value; ch.SendText("Ok.\r\n"); } catch (Exception) { ch.SendText("Bad value for craftsmanship.\r\n"); } return; } if (!MUDString.StringsNotEqual(str[1], "cost")) { obj.Cost = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "timer")) { obj.Timer = value; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "name")) { if (ch.StringTooLong(str[2])) return; obj.Name = str[2]; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "short")) { if (ch.StringTooLong(str[2])) return; obj.ShortDescription = str[2]; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "long")) { if (ch.StringTooLong(str[2])) return; obj.FullDescription = str[2]; ch.SendText("Ok.\r\n"); return; } if (!MUDString.StringsNotEqual(str[1], "spec")) { // Changed because it wasn't checking objindex data right now. -Tryden //objindex = obj.pIndexData; obj.SpecFun = StringLookup.SpecObjLookup(str[2]); if (obj.SpecFun == null) ch.SendText("Object Special is null. No such special.\r\n"); else ch.SendText("Object special set.\r\n"); return; } /*if (!MUDString.strcasecmp(str[1], "use")) { objindex = obj.pIndexData; uf = spec_use_lookup(str[2]); if (!uf) { ch.SendText( "Object Use is null. No such use.\r\n" ); return; } use_temp = new SPEC_ObjIndex.USE_DATA; if (!use_temp) { ch.SendText( "ERROR: Could not make a new use record. RAM low!\r\n" ); return; } use_temp.next = spec_use; spec_use = use_temp; spec_use.spec_fun = uf; spec_use.vnum = objindex.vnum; ch.SendText( "Object use set.\r\n" ); return; }*/ if (!MUDString.StringsNotEqual(str[1], "ed")) { if (str.Length < 4 ) { ch.SendText("Syntax: oset <object> ed <keyword> <string>\r\n"); return; } ExtendedDescription ed = new ExtendedDescription(); ed.Keyword = str[2]; ed.Description = str[3]; obj.ExtraDescription.Add(ed); ch.SendText("Ok.\r\n"); return; } /* * Generate usage message. */ CommandType.Interpret(ch, "oset"); return; }
/// <summary> /// Duplicate an object exactly minus contents. /// </summary> /// <param name="parent"></param> /// <param name="clone"></param> public static void CloneObject( Object parent, ref Object clone ) { int i; ExtendedDescription edNew; if( parent == null || clone == null ) return; // Start fixing the object. clone.Name = parent.Name; clone.ShortDescription = parent.ShortDescription; clone.FullDescription = parent.FullDescription; clone.SpecFun = parent.SpecFun; clone.Affected = parent.Affected; clone.ItemType = parent.ItemType; clone.WearFlags = parent.WearFlags; clone.UseFlags = parent.UseFlags; clone.Material = parent.Material; clone.Size = parent.Size; clone.Volume = parent.Volume; clone.Craftsmanship = parent.Craftsmanship; clone.Weight = parent.Weight; clone.Cost = parent.Cost; clone.Level = parent.Level; clone.Condition = parent.Condition; clone.Timer = parent.Timer; clone.Condition = parent.Condition; clone.Trap = parent.Trap; for( i = 0; i < Limits.NUM_ITEM_EXTRA_VECTORS; i++ ) clone.ExtraFlags[ i ] = parent.ExtraFlags[ i ]; for( i = 0; i < Limits.NUM_AFFECT_VECTORS; i++ ) clone.AffectedBy[ i ] = parent.AffectedBy[ i ]; for( i = 0; i < 8; i++ ) clone.Values[ i ] = parent.Values[ i ]; /* extended desc */ foreach( ExtendedDescription ed in parent.ExtraDescription ) { edNew = new ExtendedDescription(); edNew.Keyword = ed.Keyword; edNew.Description = ed.Description; clone.ExtraDescription.Add( edNew ); } }