Esempio n. 1
0
        /// <summary>
        /// Tables the resource.
        /// </summary>
        /// <param name="resourceFire">Resource fire.</param>
        /// <param name="resourceEarth">Resource earth.</param>
        /// <param name="resourceWater">Resource water.</param>
        /// <param name="resourceAir">Resource air.</param>
        /// <param name="resourceMagic">Resource magic.</param>
        /// <param name="resourceGold">Resource gold.</param>
        /// <param name="id">Identifier for the account.</param>
        public void TableResource(int resourceFire, int resourceEarth, int resourceWater, int resourceAir, int resourceMagic, int resourceGold, int id)
        {
            var newData = new TableResource();
                newData.Id = id;
                newData.Fire = resourceFire;
                newData.Earth = resourceEarth;
                newData.Water = resourceWater;
                newData.Air = resourceAir;
                newData.Gold = resourceGold;
                newData.Magic = resourceMagic;

                db.InsertOrReplace(newData);
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the resource.
        /// </summary>
        /// <param name="resourceFire">Resource fire.</param>
        /// <param name="resourceEarth">Resource earth.</param>
        /// <param name="resourceWater">Resource water.</param>
        /// <param name="resourceAir">Resource air.</param>
        /// <param name="resourceMagic">Resource magic.</param>
        /// <param name="resourceGold">Resource gold.</param>
        /// <param name="id">Identifier for the account.</param>
        public void UpdateResource(int resourceFire, int resourceEarth, int resourceWater, int resourceAir, int resourceMagic, int resourceGold, int id)
        {
            SQLiteConnection con = new SQLiteConnection(ServerConstants.DB_PATH);

               TableResource tr = new TableResource();
               tr.Id = id;
               tr.Fire = resourceFire;
               tr.Earth = resourceEarth;
               tr.Water = resourceWater;
               tr.Air = resourceAir;
               tr.Magic = resourceMagic;
               tr.Gold = resourceGold;

               con.InsertOrReplace(tr);
        }