protected override void OnClone(SQLiteConnection conn) { Base.Clone(conn); ToolAttributes.Clone(conn); ToolStateRates.Clone(conn); PermanentStatMods.Clone(conn); }
protected override void OnUpdate(SQLiteConnection conn) { Base.Update(conn); ToolAttributes.Update(conn); ToolStateRates.Update(conn); PermanentStatMods.Update(conn); SQLUpdate(conn, "DefaultPrice = @DefaultPrice, Consumable = @Consumable, TurnsInto = @TurnsInto"); }
protected override void OnCreate(SQLiteConnection conn) { Base.Create(conn); PermanentStatMods.Create(conn); ToolAttributes.Create(conn); SQLCreate(conn, "BaseObjectID, ToolID, PermStatMods, DefaultPrice, Consumable, TurnsInto", "@BaseObjectID, @ToolID, @PermStatMods, @DefaultPrice, @Consumable, @TurnsInto"); ToolStateRates.Create(conn); }
protected override void OnRead(SQLiteDataReader reader) { Base.Read(reader); ToolAttributes.Read(reader); ToolStateRates.Read(reader); PermanentStatMods.Read(reader); DefaultPriceInput.Text = reader["DefaultPrice"].ToString(); ConsumableInput.IsChecked = reader["Consumable"].ToString() == "True" ? true : false; TurnsIntoInput.SelectedIndex = TurnsIntoData.FindIndex(reader["TurnsInto"]); }
protected override void OnInitializeNew() { Base.InitializeNew(); ToolAttributes.InitializeNew(); ToolStateRates.InitializeNew(); PermanentStatMods.InitializeNew("PermStatMods"); DefaultPriceInput.Text = "100"; ConsumableInput.IsChecked = true; TurnsIntoInput.SelectedIndex = 0; }
public override string ValidateInputs() { string err = Base.ValidateInputs(); err += ToolAttributes.ValidateInputs(); err += ToolStateRates.ValidateInputs(); err += PermanentStatMods.ValidateInputs(0, 100); if (!Utils.PosInt(DefaultPriceInput.Text)) { err += "Default Price must be a positive integer\n"; } return(err); }