Esempio n. 1
0
        public void Save()
        {
            if (Materials.Count(mat => mat.Id == Id) != 0)
            {
                Update();
                return;
            }             //If material already exist;

            using (IDbConnection cnn = new SQLiteConnection(DBPath))
            {
                cnn.Execute($"INSERT INTO Materials VALUES(@Id, @Name, @Type, @Mod, @Weight, @Color);", this);
            }
        }
Esempio n. 2
0
 public static Material GetMaterial(string id) => Materials.Count(mat => mat.Id == id) != 0 ? Materials.First(mat => mat.Id == id) : null;