Skip to content

Commit

Permalink
flag funnction corregtion
Browse files Browse the repository at this point in the history
  • Loading branch information
cedantoine committed Jun 20, 2024
1 parent b221bb6 commit 6612645
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 29 deletions.
42 changes: 28 additions & 14 deletions Core/src/game/functions/booleans/is/line/IsLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -1174,8 +1174,10 @@ public long gameFlags(final Game game)
flags |= throughAny.gameFlags(game);
if (throughHowMuch != null)
flags |= throughHowMuch.gameFlags(game);
flags |= isVisibleFn.gameFlags(game);
flags |= useOppositesFn.gameFlags(game);
if (isVisibleFn != null)
flags |= isVisibleFn.gameFlags(game);
if (useOppositesFn != null)
flags |= useOppositesFn.gameFlags(game);

return flags;
}
Expand Down Expand Up @@ -1211,8 +1213,10 @@ public BitSet concepts(final Game game)
concepts.or(dirn.concepts(game));
if (throughHowMuch != null)
concepts.or(throughHowMuch.concepts(game));
concepts.or(isVisibleFn.concepts(game));
concepts.or(useOppositesFn.concepts(game));
if (isVisibleFn != null)
concepts.or(isVisibleFn.concepts(game));
if (useOppositesFn != null)
concepts.or(useOppositesFn.concepts(game));

return concepts;
}
Expand Down Expand Up @@ -1247,8 +1251,10 @@ public BitSet writesEvalContextRecursive()
writeEvalContext.or(dirn.writesEvalContextRecursive());
if (throughHowMuch != null)
writeEvalContext.or(throughHowMuch.writesEvalContextRecursive());
writeEvalContext.or(isVisibleFn.writesEvalContextRecursive());
writeEvalContext.or(useOppositesFn.writesEvalContextRecursive());
if (isVisibleFn != null)
writeEvalContext.or(isVisibleFn.writesEvalContextRecursive());
if (useOppositesFn != null)
writeEvalContext.or(useOppositesFn.writesEvalContextRecursive());
return writeEvalContext;
}

Expand Down Expand Up @@ -1282,8 +1288,10 @@ public BitSet readsEvalContextRecursive()
readEvalContext.or(dirn.readsEvalContextRecursive());
if (throughHowMuch != null)
readEvalContext.or(throughHowMuch.readsEvalContextRecursive());
readEvalContext.or(isVisibleFn.readsEvalContextRecursive());
readEvalContext.or(useOppositesFn.readsEvalContextRecursive());
if (isVisibleFn != null)
readEvalContext.or(isVisibleFn.readsEvalContextRecursive());
if (useOppositesFn != null)
readEvalContext.or(useOppositesFn.readsEvalContextRecursive());
return readEvalContext;
}

Expand Down Expand Up @@ -1318,8 +1326,10 @@ public void preprocess(final Game game)
throughAny.preprocess(game);
if (throughHowMuch != null)
throughHowMuch.preprocess(game);
isVisibleFn.preprocess(game);
useOppositesFn.preprocess(game);
if (isVisibleFn != null)
isVisibleFn.preprocess(game);
if (useOppositesFn != null)
useOppositesFn.preprocess(game);
}

@Override
Expand Down Expand Up @@ -1354,8 +1364,10 @@ public boolean missingRequirement(final Game game)
missingRequirement |= topFn.missingRequirement(game);
if (throughHowMuch != null)
missingRequirement |= throughHowMuch.missingRequirement(game);
missingRequirement |= isVisibleFn.missingRequirement(game);
missingRequirement |= useOppositesFn.missingRequirement(game);
if (isVisibleFn != null)
missingRequirement |= isVisibleFn.missingRequirement(game);
if (useOppositesFn != null)
missingRequirement |= useOppositesFn.missingRequirement(game);
return missingRequirement;
}

Expand Down Expand Up @@ -1391,8 +1403,10 @@ public boolean willCrash(final Game game)
willCrash |= topFn.willCrash(game);
if (throughHowMuch != null)
willCrash |= throughHowMuch.willCrash(game);
willCrash |= isVisibleFn.willCrash(game);
willCrash |= useOppositesFn.willCrash(game);
if (isVisibleFn != null)
willCrash |= isVisibleFn.willCrash(game);
if (useOppositesFn != null)
willCrash |= useOppositesFn.willCrash(game);
return willCrash;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ public long gameFlags(final Game game)
{
long gameFlags = condition.gameFlags(game);
gameFlags |= SiteType.gameFlags(type);
gameFlags |= isVisibleFn.gameFlags(game);
if (isVisibleFn != null)
gameFlags |= isVisibleFn.gameFlags(game);
if (dirnChoice != null)
gameFlags |= dirnChoice.gameFlags(game);
return gameFlags;
Expand All @@ -293,7 +294,8 @@ public BitSet concepts(final Game game)
concepts.or(condition.concepts(game));
if (dirnChoice != null)
concepts.or(dirnChoice.concepts(game));
concepts.or(isVisibleFn.concepts(game));
if (isVisibleFn != null)
concepts.or(isVisibleFn.concepts(game));

return concepts;
}
Expand All @@ -305,7 +307,8 @@ public BitSet writesEvalContextRecursive()
writeEvalContext.or(condition.writesEvalContextRecursive());
if (dirnChoice != null)
writeEvalContext.or(dirnChoice.writesEvalContextRecursive());
writeEvalContext.or(isVisibleFn.writesEvalContextRecursive());
if (isVisibleFn != null)
writeEvalContext.or(isVisibleFn.writesEvalContextRecursive());
return writeEvalContext;
}

Expand All @@ -324,7 +327,8 @@ public BitSet readsEvalContextRecursive()
readEvalContext.or(condition.readsEvalContextRecursive());
if (dirnChoice != null)
readEvalContext.or(dirnChoice.readsEvalContextRecursive());
readEvalContext.or(isVisibleFn.readsEvalContextRecursive());
if (isVisibleFn != null)
readEvalContext.or(isVisibleFn.readsEvalContextRecursive());
return readEvalContext;
}

Expand All @@ -335,7 +339,8 @@ public void preprocess(final Game game)
condition.preprocess(game);
if (dirnChoice != null)
dirnChoice.preprocess(game);
isVisibleFn.preprocess(game);
if (isVisibleFn != null)
isVisibleFn.preprocess(game);
}

@Override
Expand All @@ -345,7 +350,8 @@ public boolean missingRequirement(final Game game)
missingRequirement |= condition.missingRequirement(game);
if (dirnChoice != null)
missingRequirement |= dirnChoice.missingRequirement(game);
missingRequirement |= isVisibleFn.missingRequirement(game);
if (isVisibleFn != null)
missingRequirement |= isVisibleFn.missingRequirement(game);
return missingRequirement;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,17 @@ public void preprocess(final Game game)
{
type = SiteType.use(type, game);
condition.preprocess(game);
dirnChoice.preprocess(game);
if (dirnChoice != null)
dirnChoice.preprocess(game);
}

@Override
public boolean missingRequirement(final Game game)
{
boolean missingRequirement = false;
missingRequirement |= condition.missingRequirement(game);
missingRequirement |= dirnChoice.missingRequirement(game);
if (dirnChoice != null)
missingRequirement |= dirnChoice.missingRequirement(game);
return missingRequirement;
}

Expand Down
21 changes: 14 additions & 7 deletions Core/src/game/functions/region/sites/group/SitesGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ public long gameFlags(final Game game)
gameFlags |= startLocationFn.gameFlags(game);
if (condition != null)
gameFlags |= condition.gameFlags(game);
gameFlags |= isVisibleFn.gameFlags(game);
if (isVisibleFn != null)
gameFlags |= isVisibleFn.gameFlags(game);

return gameFlags;
}
Expand All @@ -276,7 +277,8 @@ public BitSet concepts(final Game game)

if (dirnChoice != null)
concepts.or(dirnChoice.concepts(game));
concepts.or(isVisibleFn.concepts(game));
if (isVisibleFn != null)
concepts.or(isVisibleFn.concepts(game));

return concepts;
}
Expand All @@ -291,7 +293,8 @@ public BitSet writesEvalContextRecursive()

if (dirnChoice != null)
writeEvalContext.or(dirnChoice.writesEvalContextRecursive());
writeEvalContext.or(isVisibleFn.writesEvalContextRecursive());
if (isVisibleFn != null)
writeEvalContext.or(isVisibleFn.writesEvalContextRecursive());
return writeEvalContext;
}

Expand All @@ -314,7 +317,8 @@ public BitSet readsEvalContextRecursive()

if (dirnChoice != null)
readEvalContext.or(dirnChoice.readsEvalContextRecursive());
readEvalContext.or(isVisibleFn.readsEvalContextRecursive());
if (isVisibleFn != null)
readEvalContext.or(isVisibleFn.readsEvalContextRecursive());
return readEvalContext;
}

Expand All @@ -325,7 +329,8 @@ public boolean missingRequirement(final Game game)
missingRequirement |= startLocationFn.missingRequirement(game);
if (condition != null)
missingRequirement |= condition.missingRequirement(game);
missingRequirement |= isVisibleFn.missingRequirement(game);
if (isVisibleFn != null)
missingRequirement |= isVisibleFn.missingRequirement(game);
return missingRequirement;
}

Expand All @@ -336,7 +341,8 @@ public boolean willCrash(final Game game)
willCrash |= startLocationFn.willCrash(game);
if (condition != null)
willCrash |= condition.willCrash(game);
willCrash |= isVisibleFn.willCrash(game);
if (isVisibleFn != null)
willCrash |= isVisibleFn.willCrash(game);
return willCrash;
}

Expand All @@ -347,7 +353,8 @@ public void preprocess(final Game game)
if (condition != null)
condition.preprocess(game);
startLocationFn.preprocess(game);
isVisibleFn.preprocess(game);
if (isVisibleFn != null)
isVisibleFn.preprocess(game);
}

//-------------------------------------------------------------------------
Expand Down

0 comments on commit 6612645

Please sign in to comment.