-
-
Save fireundubh/6a25558a9ab1a54f35dc608fbb40cee1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CompareFlags(asTag: String; e, m: IInterface; sPath, sFlagName: String; bAddTag, bOperation: Boolean): Boolean; | |
var | |
x, y, a, b: IInterface; | |
sa, sb, sTestName: String; | |
bResult: Boolean; | |
begin | |
if TagExists(asTag) then | |
exit; | |
Result := False; | |
// flags arrays | |
x := ElementByPath(e, sPath); | |
y := ElementByPath(m, sPath); | |
// individual flags | |
a := ElementByName(x, sFlagName); | |
b := ElementByName(y, sFlagName); | |
// individual flag edit values | |
sa := GetEditValue(a); | |
sb := GetEditValue(b); | |
if bOperation then | |
bResult := StrToBool(sa) <> StrToBool(sb) // only used for Behave Like Exterior, Use Sky Lighting, and Has Water | |
else | |
bResult := StrToBool(sa) or StrToBool(sb); | |
if bAddTag and bResult then | |
begin | |
if bOperation then | |
sTestName := '[CompareFlags:NOT]' | |
else | |
sTestName := '[CompareFlags:OR]'; | |
AddLogEntry(asTag, sTestName, x, y); | |
AddTag(asTag); | |
end; | |
Result := bResult; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment