protected override IEnumerable <KeyValuePair <int, DiplomacyInfo> > OnSynchronizeWithDatabase( SQLiteConnection db, IEnumerable <int> range) { if (range == null) { foreach (Row r in db.ExecuteTableQuery(Queries.GetDiplomacyInfos, true)) { DiplomacyInfo o = DiplomacyStatesCache.GetDiplomacyInfoFromRow(r); this.TryInsertByPlayer(o.PlayerID, o.TowardsPlayerID, o.ID); yield return(new KeyValuePair <int, DiplomacyInfo>(o.ID, o)); } } else { foreach (int num in range) { foreach (Row r in db.ExecuteTableQuery(string.Format(Queries.GetDiplomacyInfo, (object)num.ToSQLiteValue()), true)) { DiplomacyInfo o = DiplomacyStatesCache.GetDiplomacyInfoFromRow(r); this.TryInsertByPlayer(o.PlayerID, o.TowardsPlayerID, o.ID); yield return(new KeyValuePair <int, DiplomacyInfo>(o.ID, o)); } } } }
public PlayersCache( SQLiteConnection db, AssetDatabase assets, DiplomacyStatesCache diplomacy_states) : base(db, assets) { this.diplomacy_states = diplomacy_states; }