/// <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 ICharacterStatusEffectTable source, NetGore.Db.DbParameterValues paramValues) { for (int i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "character_id": paramValues[i] = (System.Int32)source.CharacterID; break; case "id": paramValues[i] = (System.Int32)source.ID; break; case "power": paramValues[i] = (System.UInt16)source.Power; break; case "status_effect_id": paramValues[i] = (System.Byte)source.StatusEffect; break; case "time_left_secs": paramValues[i] = (System.UInt16)source.TimeLeftSecs; break; } } }
/// <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 ICharacterStatusEffectTable source, NetGore.Db.DbParameterValues paramValues) { paramValues["character_id"] = (System.Int32)source.CharacterID; paramValues["id"] = (System.Int32)source.ID; paramValues["power"] = (System.UInt16)source.Power; paramValues["status_effect_id"] = (System.Byte)source.StatusEffect; paramValues["time_left_secs"] = (System.UInt16)source.TimeLeftSecs; }
/// <summary> /// Checks if this <see cref="ICharacterStatusEffectTable"/> contains the same values as another <see cref="ICharacterStatusEffectTable"/>. /// </summary> /// <param name="source">The source <see cref="ICharacterStatusEffectTable"/>.</param> /// <param name="otherItem">The <see cref="ICharacterStatusEffectTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="ICharacterStatusEffectTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this ICharacterStatusEffectTable source, ICharacterStatusEffectTable otherItem) { return(Equals(source.CharacterID, otherItem.CharacterID) && Equals(source.ID, otherItem.ID) && Equals(source.Power, otherItem.Power) && Equals(source.StatusEffect, otherItem.StatusEffect) && Equals(source.TimeLeftSecs, otherItem.TimeLeftSecs)); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this CharacterStatusEffectTable. /// </summary> /// <param name="source">The ICharacterStatusEffectTable to copy the values from.</param> public void CopyValuesFrom(ICharacterStatusEffectTable source) { this.CharacterID = (DemoGame.CharacterID)source.CharacterID; this.ID = (DemoGame.ActiveStatusEffectID)source.ID; this.Power = (System.UInt16)source.Power; this.StatusEffect = (DemoGame.StatusEffectType)source.StatusEffect; this.TimeLeftSecs = (System.UInt16)source.TimeLeftSecs; }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this CharacterStatusEffectTable. /// </summary> /// <param name="source">The ICharacterStatusEffectTable to copy the values from.</param> public void CopyValuesFrom(ICharacterStatusEffectTable source) { CharacterID = source.CharacterID; ID = source.ID; Power = source.Power; StatusEffect = source.StatusEffect; TimeLeftSecs = source.TimeLeftSecs; }
/// <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(ICharacterStatusEffectTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic) { dic["character_id"] = (DemoGame.CharacterID)source.CharacterID; dic["id"] = (DemoGame.ActiveStatusEffectID)source.ID; dic["power"] = (System.UInt16)source.Power; dic["status_effect_id"] = (DemoGame.StatusEffectType)source.StatusEffect; dic["time_left_secs"] = (System.UInt16)source.TimeLeftSecs; }
/// <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(ICharacterStatusEffectTable source, IDictionary <String, Object> dic) { dic["character_id"] = source.CharacterID; dic["id"] = source.ID; dic["power"] = source.Power; dic["status_effect_id"] = source.StatusEffect; dic["time_left_secs"] = source.TimeLeftSecs; }
/// <summary> /// Checks if this <see cref="ICharacterStatusEffectTable"/> contains the same values as another <see cref="ICharacterStatusEffectTable"/>. /// </summary> /// <param name="source">The source <see cref="ICharacterStatusEffectTable"/>.</param> /// <param name="otherItem">The <see cref="ICharacterStatusEffectTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="ICharacterStatusEffectTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this ICharacterStatusEffectTable source, ICharacterStatusEffectTable otherItem) { return Equals(source.CharacterID, otherItem.CharacterID) && Equals(source.ID, otherItem.ID) && Equals(source.Power, otherItem.Power) && Equals(source.StatusEffect, otherItem.StatusEffect) && Equals(source.TimeLeftSecs, otherItem.TimeLeftSecs); }
/// <summary> /// Initializes a new instance of the <see cref="CharacterStatusEffectTable"/> class. /// </summary> /// <param name="source">ICharacterStatusEffectTable to copy the initial values from.</param> public CharacterStatusEffectTable(ICharacterStatusEffectTable source) { CopyValuesFrom(source); }
/// <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(ICharacterStatusEffectTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic) { dic["character_id"] = (DemoGame.CharacterID)source.CharacterID; dic["id"] = (DemoGame.ActiveStatusEffectID)source.ID; dic["power"] = (System.UInt16)source.Power; dic["status_effect_id"] = (DemoGame.StatusEffectType)source.StatusEffect; dic["time_left_secs"] = (System.UInt16)source.TimeLeftSecs; }
/// <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(ICharacterStatusEffectTable source, IDictionary<String, Object> dic) { dic["character_id"] = source.CharacterID; dic["id"] = source.ID; dic["power"] = source.Power; dic["status_effect_id"] = source.StatusEffect; dic["time_left_secs"] = source.TimeLeftSecs; }