Пример #1
0
        public void Save()
        {
            if (Generals.Count(gen => gen.Id == Id) != 0)
            {
                Update();
                return;
            }             //If general already exist;

            using (IDbConnection cnn = new SQLiteConnection(DBPath))
            {
                cnn.Execute($"INSERT INTO Generals VALUES(@Id, @Name, @Description, @Type, @Health, @Size, @BuildTime, @BuildCost, @Mod, @Weight);", this);
            }
        }
Пример #2
0
 public static General GetGeneral(string id) => Generals.Count(gen => gen.Id == id) != 0 ? Generals.First(gen => gen.Id == id) : null;