protected override void OnClone(SQLiteConnection conn) { Base.Clone(conn); ToolAttributes.Clone(conn); ToolStateRates.Clone(conn); EquipBoosts.Clone(conn); }
protected override void OnUpdate(SQLiteConnection conn) { Base.Update(conn); ToolAttributes.Update(conn); ToolStateRates.Update(conn); EquipBoosts.Update(conn); SQLUpdate(conn, "WeaponType = @WeaponType, Range = @Range, CollideRange = @CollideRange, DefaultPrice = @DefaultPrice, DefaultQuantity = @DefaultQuantity"); }
protected override void OnCreate(SQLiteConnection conn) { Base.Create(conn); EquipBoosts.Create(conn); ToolAttributes.Create(conn); SQLCreate(conn, "BaseObjectID, ToolID, EquipBoosts, WeaponType, Range, CollideRange, DefaultPrice, DefaultQuantity", "@BaseObjectID, @ToolID, @EquipBoosts, @WeaponType, @Range, @CollideRange, @DefaultPrice, @DefaultQuantity"); ToolStateRates.Create(conn); }
protected override void OnRead(SQLiteDataReader reader) { Base.Read(reader); ToolAttributes.Read(reader); ToolStateRates.Read(reader); EquipBoosts.Read(reader); WeaponTypeInput.SelectedIndex = WeaponTypeData.FindIndex(reader["WeaponType"]); RangeInput.Text = reader["Range"].ToString(); CollideRangeInput.IsChecked = reader["CollideRange"].ToString() == "True" ? true : false; DefaultPriceInput.Text = reader["DefaultPrice"].ToString(); DefaultQuantityInput.Text = reader["DefaultQuantity"].ToString(); }
protected override void OnInitializeNew() { Base.InitializeNew(); ToolAttributes.InitializeNew(); ToolStateRates.InitializeNew(); EquipBoosts.InitializeNew("EquipBoosts"); WeaponTypeInput.SelectedIndex = 0; RangeInput.Text = "2"; CollideRangeInput.IsChecked = true; DefaultPriceInput.Text = "100"; DefaultQuantityInput.Text = "0"; }
public override string ValidateInputs() { string err = Base.ValidateInputs(); err += ToolAttributes.ValidateInputs(); err += ToolStateRates.ValidateInputs(); err += EquipBoosts.ValidateInputs(0, 500); if (!Utils.PosInt(RangeInput.Text, 10)) { err += "Range must be an integer betweem 0 and 10\n"; } if (!Utils.PosInt(DefaultPriceInput.Text)) { err += "Default Price must be a positive integer\n"; } if (!Utils.PosInt(DefaultQuantityInput.Text)) { err += "Default Quantity must be a positive integer\n"; } return(err); }