mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Rename PluginInterface::DoFormIDsOverlap()
The use of FormIDs doesn't apply to Morrowind and it's really the records that are significant - FormIDs are an implementation detail. This also aligns with other use of records in names.
This commit is contained in:
@@ -126,7 +126,7 @@ public:
|
||||
* Morrowind, which doesn't have FormIDs and so has other identifying
|
||||
* data compared.
|
||||
*/
|
||||
virtual bool DoFormIDsOverlap(const PluginInterface& plugin) const = 0;
|
||||
virtual bool DoRecordsOverlap(const PluginInterface& plugin) const = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -280,7 +280,7 @@ bool Plugin::IsEmpty() const { return isEmpty_; }
|
||||
|
||||
bool Plugin::LoadsArchive() const { return !archivePaths_.empty(); }
|
||||
|
||||
bool Plugin::DoFormIDsOverlap(const PluginInterface& plugin) const {
|
||||
bool Plugin::DoRecordsOverlap(const PluginInterface& plugin) const {
|
||||
try {
|
||||
auto& otherPlugin = dynamic_cast<const Plugin&>(plugin);
|
||||
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ public:
|
||||
bool IsValidAsLightPlugin() const override;
|
||||
bool IsEmpty() const override;
|
||||
bool LoadsArchive() const override;
|
||||
bool DoFormIDsOverlap(const PluginInterface& plugin) const override;
|
||||
bool DoRecordsOverlap(const PluginInterface& plugin) const override;
|
||||
size_t GetOverlapSize(
|
||||
const std::vector<const PluginInterface*>& plugins) const override;
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ size_t PluginSortingData::GetOverrideRecordCount() const {
|
||||
bool PluginSortingData::DoRecordsOverlap(
|
||||
const PluginSortingData& plugin) const {
|
||||
return plugin_ != nullptr && plugin.plugin_ != nullptr &&
|
||||
plugin_->DoFormIDsOverlap(*plugin.plugin_);
|
||||
plugin_->DoRecordsOverlap(*plugin.plugin_);
|
||||
}
|
||||
|
||||
size_t PluginSortingData::GetAssetCount() const {
|
||||
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
bool IsValidAsLightPlugin() const override { return false; }
|
||||
bool IsEmpty() const override { return false; }
|
||||
bool LoadsArchive() const override { return false; }
|
||||
bool DoFormIDsOverlap(const PluginInterface&) const override { return true; }
|
||||
bool DoRecordsOverlap(const PluginInterface&) const override { return true; }
|
||||
|
||||
size_t GetOverrideRecordCount() const override { return 0; };
|
||||
uint32_t GetRecordAndGroupCount() const override { return 0; };
|
||||
@@ -477,17 +477,17 @@ TEST_P(PluginTest, getFileSizeShouldReturnCorrectValueForAGhostedPlugin) {
|
||||
}
|
||||
|
||||
TEST_P(PluginTest,
|
||||
DoFormIDsOverlapShouldReturnFalseIfTheArgumentIsNotAPluginObject) {
|
||||
doRecordsOverlapShouldReturnFalseIfTheArgumentIsNotAPluginObject) {
|
||||
Plugin plugin1(
|
||||
game_.Type(), game_.GetCache(), game_.DataPath() / blankEsm, false);
|
||||
OtherPluginType plugin2;
|
||||
|
||||
EXPECT_FALSE(plugin1.DoFormIDsOverlap(plugin2));
|
||||
EXPECT_TRUE(plugin2.DoFormIDsOverlap(plugin1));
|
||||
EXPECT_FALSE(plugin1.DoRecordsOverlap(plugin2));
|
||||
EXPECT_TRUE(plugin2.DoRecordsOverlap(plugin1));
|
||||
}
|
||||
|
||||
TEST_P(PluginTest,
|
||||
DoFormIDsOverlapShouldReturnFalseForTwoPluginsWithOnlyHeadersLoaded) {
|
||||
doRecordsOverlapShouldReturnFalseForTwoPluginsWithOnlyHeadersLoaded) {
|
||||
Plugin plugin1(
|
||||
game_.Type(), game_.GetCache(), game_.DataPath() / blankEsm, true);
|
||||
Plugin plugin2(game_.Type(),
|
||||
@@ -495,23 +495,23 @@ TEST_P(PluginTest,
|
||||
game_.DataPath() / blankMasterDependentEsm,
|
||||
true);
|
||||
|
||||
EXPECT_FALSE(plugin1.DoFormIDsOverlap(plugin2));
|
||||
EXPECT_FALSE(plugin2.DoFormIDsOverlap(plugin1));
|
||||
EXPECT_FALSE(plugin1.DoRecordsOverlap(plugin2));
|
||||
EXPECT_FALSE(plugin2.DoRecordsOverlap(plugin1));
|
||||
}
|
||||
|
||||
TEST_P(PluginTest,
|
||||
DoFormIDsOverlapShouldReturnFalseIfThePluginsHaveUnrelatedRecords) {
|
||||
doRecordsOverlapShouldReturnFalseIfThePluginsHaveUnrelatedRecords) {
|
||||
Plugin plugin1(
|
||||
game_.Type(), game_.GetCache(), game_.DataPath() / blankEsm, false);
|
||||
Plugin plugin2(
|
||||
game_.Type(), game_.GetCache(), game_.DataPath() / blankEsp, false);
|
||||
|
||||
EXPECT_FALSE(plugin1.DoFormIDsOverlap(plugin2));
|
||||
EXPECT_FALSE(plugin2.DoFormIDsOverlap(plugin1));
|
||||
EXPECT_FALSE(plugin1.DoRecordsOverlap(plugin2));
|
||||
EXPECT_FALSE(plugin2.DoRecordsOverlap(plugin1));
|
||||
}
|
||||
|
||||
TEST_P(PluginTest,
|
||||
DoFormIDsOverlapShouldReturnTrueIfOnePluginOverridesTheOthersRecords) {
|
||||
doRecordsOverlapShouldReturnTrueIfOnePluginOverridesTheOthersRecords) {
|
||||
Plugin plugin1(
|
||||
game_.Type(), game_.GetCache(), game_.DataPath() / blankEsm, false);
|
||||
Plugin plugin2(game_.Type(),
|
||||
@@ -519,8 +519,8 @@ TEST_P(PluginTest,
|
||||
game_.DataPath() / blankMasterDependentEsm,
|
||||
false);
|
||||
|
||||
EXPECT_TRUE(plugin1.DoFormIDsOverlap(plugin2));
|
||||
EXPECT_TRUE(plugin2.DoFormIDsOverlap(plugin1));
|
||||
EXPECT_TRUE(plugin1.DoRecordsOverlap(plugin2));
|
||||
EXPECT_TRUE(plugin2.DoRecordsOverlap(plugin1));
|
||||
}
|
||||
|
||||
TEST_P(PluginTest,
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
bool LoadsArchive() const override { return false; }
|
||||
|
||||
bool DoFormIDsOverlap(const PluginInterface& plugin) const override {
|
||||
bool DoRecordsOverlap(const PluginInterface& plugin) const override {
|
||||
const auto otherPlugin = dynamic_cast<const TestPlugin*>(&plugin);
|
||||
return recordsOverlapWith.count(&plugin) != 0 ||
|
||||
otherPlugin->recordsOverlapWith.count(this) != 0;
|
||||
|
||||
Reference in New Issue
Block a user