/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The key must already exist in the DbParameterValues /// for the value to be copied over. If any of the keys in the DbParameterValues do not /// match one of the column names, or if there is no field for a key, then it will be /// ignored. Because of this, it is important to be careful when using this method /// since columns or keys can be skipped without any indication. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void TryCopyValues(this IAllianceHostileTable source, DbParameterValues paramValues) { for (var i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "alliance_id": paramValues[i] = (Byte)source.AllianceID; break; case "hostile_id": paramValues[i] = (Byte)source.HostileID; break; } } }
/// <summary> /// Checks if this <see cref="IAllianceHostileTable"/> contains the same values as another <see cref="IAllianceHostileTable"/>. /// </summary> /// <param name="source">The source <see cref="IAllianceHostileTable"/>.</param> /// <param name="otherItem">The <see cref="IAllianceHostileTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IAllianceHostileTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IAllianceHostileTable source, IAllianceHostileTable otherItem) { return Equals(source.AllianceID, otherItem.AllianceID) && Equals(source.HostileID, otherItem.HostileID); }
/// <summary> /// Copies the column values into the given DbParameterValues using the database column name /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="paramValues">The DbParameterValues to copy the values into.</param> public static void CopyValues(this IAllianceHostileTable source, NetGore.Db.DbParameterValues paramValues) { paramValues["alliance_id"] = (System.Byte)source.AllianceID; paramValues["hostile_id"] = (System.Byte)source.HostileID; }
/// <summary> /// Checks if this <see cref="IAllianceHostileTable"/> contains the same values as another <see cref="IAllianceHostileTable"/>. /// </summary> /// <param name="source">The source <see cref="IAllianceHostileTable"/>.</param> /// <param name="otherItem">The <see cref="IAllianceHostileTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IAllianceHostileTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IAllianceHostileTable source, IAllianceHostileTable otherItem) { return(Equals(source.AllianceID, otherItem.AllianceID) && Equals(source.HostileID, otherItem.HostileID)); }
/// <summary> /// Initializes a new instance of the <see cref="AllianceHostileTable"/> class. /// </summary> /// <param name="source">IAllianceHostileTable to copy the initial values from.</param> public AllianceHostileTable(IAllianceHostileTable source) { CopyValuesFrom(source); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this AllianceHostileTable. /// </summary> /// <param name="source">The IAllianceHostileTable to copy the values from.</param> public void CopyValuesFrom(IAllianceHostileTable source) { AllianceID = source.AllianceID; HostileID = source.HostileID; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IAllianceHostileTable source, IDictionary <String, Object> dic) { dic["alliance_id"] = source.AllianceID; dic["hostile_id"] = source.HostileID; }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this AllianceHostileTable. /// </summary> /// <param name="source">The IAllianceHostileTable to copy the values from.</param> public void CopyValuesFrom(IAllianceHostileTable source) { this.AllianceID = (DemoGame.AllianceID)source.AllianceID; this.HostileID = (DemoGame.AllianceID)source.HostileID; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IAllianceHostileTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic) { dic["alliance_id"] = (DemoGame.AllianceID)source.AllianceID; dic["hostile_id"] = (DemoGame.AllianceID)source.HostileID; }
/// <summary> /// Initializes a new instance of the <see cref="AllianceHostileTable"/> class. /// </summary> /// <param name="source">IAllianceHostileTable to copy the initial values from.</param> public AllianceHostileTable(IAllianceHostileTable source) { CopyValuesFrom(source); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this AllianceHostileTable. /// </summary> /// <param name="source">The IAllianceHostileTable to copy the values from.</param> public void CopyValuesFrom(IAllianceHostileTable source) { this.AllianceID = (DemoGame.AllianceID)source.AllianceID; this.HostileID = (DemoGame.AllianceID)source.HostileID; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IAllianceHostileTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic) { dic["alliance_id"] = (DemoGame.AllianceID)source.AllianceID; dic["hostile_id"] = (DemoGame.AllianceID)source.HostileID; }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this AllianceHostileTable. /// </summary> /// <param name="source">The IAllianceHostileTable to copy the values from.</param> public void CopyValuesFrom(IAllianceHostileTable source) { AllianceID = source.AllianceID; HostileID = source.HostileID; }
/// <summary> /// Copies the column values into the given Dictionary using the database column name /// with a prefixed @ as the key. The keys must already exist in the Dictionary; /// this method will not create them if they are missing. /// </summary> /// <param name="source">The object to copy the values from.</param> /// <param name="dic">The Dictionary to copy the values into.</param> public static void CopyValues(IAllianceHostileTable source, IDictionary<String, Object> dic) { dic["alliance_id"] = source.AllianceID; dic["hostile_id"] = source.HostileID; }