Пример #1
0
 protected override void OnClone(SQLiteConnection conn)
 {
     Base.Clone(conn);
     ToolAttributes.Clone(conn);
     ToolStateRates.Clone(conn);
     PermanentStatMods.Clone(conn);
 }
Пример #2
0
 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");
 }
Пример #3
0
 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);
 }
Пример #4
0
 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"]);
 }
Пример #5
0
 protected override void OnInitializeNew()
 {
     Base.InitializeNew();
     ToolAttributes.InitializeNew();
     ToolStateRates.InitializeNew();
     PermanentStatMods.InitializeNew("PermStatMods");
     DefaultPriceInput.Text       = "100";
     ConsumableInput.IsChecked    = true;
     TurnsIntoInput.SelectedIndex = 0;
 }
Пример #6
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);
        }