/// <summary> /// Synchronizes this database against other, /// adding all technologies from the other that /// this one doesn't have. /// </summary> /// <param name="otherDatabase">The other database</param> /// <param name="twoway">Whether the other database should be synced against this one too or not.</param> public void Sync(TechnologyDatabaseComponent component, TechnologyDatabaseComponent otherDatabase, bool twoway = true) { foreach (var tech in otherDatabase.Technologies) { if (!component.IsTechnologyUnlocked(tech)) { AddTechnology(component, tech); } } if (twoway) { Sync(otherDatabase, component, false); } Dirty(component); }
public bool IsTechnologyUnlocked(TechnologyPrototype technology) { return(_technologyDatabase?.IsTechnologyUnlocked(technology) ?? false); }