public void EnumerateLobby(Action<string, string, string> yield) { using (var c = new SQLiteConnection(ConnectionString)) { c.Open(); var DBItems = new InternalSQLiteKeyValueGenericTable { Connection = c, Name = "DBItems" }; foreach (var id in DBItems.GetKeys()) { var p = DBItems.String[id]; yield(id, p.x, p.y); } c.Close(); } //foreach (var item in Items) //{ // yield(item.Item1, item.Item2, item.Item3); //} yield("", "", ""); }
//static List<Tuple<string, string, string>> Items = new List<Tuple<string, string, string>>(); public void UpdateLobby(string id, string x, string y, Action<string> yield) { //Items.RemoveAll( // p => p.Item1 == id //); using (var c = new SQLiteConnection(ConnectionString)) { c.Open(); var DBItems = new InternalSQLiteKeyValueGenericTable { Connection = c, Name = "DBItems" }; DBItems.String[id] = new InternalSQLiteKeyValueGenericTable.Point { x = x, y = y }; //Items.Add(Tuple.Create(id, x, y)); c.Close(); } yield("hack"); }