Skip to content

Commit

Permalink
Merge pull request #27 from cedantoine/dev_clean
Browse files Browse the repository at this point in the history
Additions and modifications of ludemes for 3D games
  • Loading branch information
DennisSoemers authored Jun 20, 2024
2 parents 7f78d1e + 6612645 commit 75fb6ec
Show file tree
Hide file tree
Showing 17 changed files with 1,643 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/trials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Run Trials

on:
push:
branches: [ "master", "dev" ]
branches: [ "master", "dev", "dev_clean"]
pull_request:
branches: [ "master", "dev" ]
branches: [ "master", "dev", "dev_clean"]

jobs:
build:
Expand Down
7 changes: 7 additions & 0 deletions Core/src/game/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import game.rules.meta.Gravity;
import game.rules.meta.MetaRule;
import game.rules.meta.Pin;
import game.rules.meta.NoStackOn;
import game.rules.meta.Swap;
import game.rules.phase.NextPhase;
import game.rules.phase.Phase;
Expand Down Expand Up @@ -2524,6 +2525,9 @@ IsLineType.Line, null, new IntConstant(3),
null,
null,
null,
null,
null,
null,
null
),
null,
Expand Down Expand Up @@ -2852,6 +2856,9 @@ else if (isAlternatingMoveGame())

// Meta-rule: We apply the Pin meta-rule if existing.
Pin.apply(context,legalMoves);

// Meta-rule: We apply the NoStackOnFallen meta-rule if existing.
NoStackOn.apply(context, legalMoves);
}
else if (isSimulationMoveGame())
{
Expand Down
45 changes: 26 additions & 19 deletions Core/src/game/functions/booleans/is/Is.java
Original file line number Diff line number Diff line change
Expand Up @@ -832,23 +832,27 @@ public class Is extends BaseBooleanFunction
/**
* For test relative to a line.
*
* @param isType The type of query to perform.
* @param type The graph element type [default SiteType of the board].
* @param length Minimum length of lines.
* @param dirn Direction category to which potential lines must belong
* [Adjacent].
* @param through Location through which the line must pass.
* @param throughAny The line must pass through at least one of these sites.
* @param who The owner of the pieces making a line [Mover].
* @param what The index of the component composing the line [(mover)].
* @param whats The indices of the components composing the line.
* @param exact If true, then lines cannot exceed minimum length [False].
* @param contiguous If true, the line has to be contiguous [True].
* @param If The condition on each site on the line [True].
* @param byLevel If true, then lines are detected in using the level in a
* stack [False].
* @param top If true, then lines are detected in using only the top level
* in a stack [False].
* @param isType The type of query to perform.
* @param type The graph element type [default SiteType of the board].
* @param length Minimum length of lines.
* @param dirn Direction category to which potential lines must belong
* [Adjacent].
* @param through Location through which the line must pass.
* @param throughAny The line must pass through at least one of these sites.
* @param who The owner of the pieces making a line [Mover].
* @param what The index of the component composing the line [(mover)].
* @param whats The indices of the components composing the line.
* @param exact If true, then lines cannot exceed minimum length [False].
* @param contiguous If true, the line has to be contiguous [True].
* @param If The condition on each site on the line [True].
* @param byLevel If true, then lines are detected in using the level in a
* stack [False].
* @param top If true, then lines are detected in using only the top level
* in a stack [False].
* @param throughHowMuch The number of minimum component types to compose the line
* @param isVisible If a line has to be visible from above (and not cut by other components) (used in 3D games)
* @param useOpposites Whether to use the opposite radial to try and find line
* (i.e whether to iterate in both opposite directions of analyzed component to find line)
*
* @example (is Line 3)
* @example (is Line 5 Orthogonal if:(not (is In (to) (sites Mover))))
Expand All @@ -868,7 +872,10 @@ public class Is extends BaseBooleanFunction
@Opt @Name final BooleanFunction contiguous,
@Opt @Name final BooleanFunction If,
@Opt @Name final BooleanFunction byLevel,
@Opt @Name final BooleanFunction top
@Opt @Name final BooleanFunction top,
@Opt @Name final IntFunction throughHowMuch,
@Opt @Name final BooleanFunction isVisible,
@Opt @Name final BooleanFunction useOpposites
)
{
int numNonNull = 0;
Expand Down Expand Up @@ -896,7 +903,7 @@ public class Is extends BaseBooleanFunction
switch (isType)
{
case Line:
return new IsLine(type, length, dirn, through, throughAny, who, what, whats, exact, contiguous, If, byLevel, top);
return new IsLine(type, length, dirn, through, throughAny, who, what, whats, exact, contiguous, If, byLevel, top, throughHowMuch, isVisible, useOpposites);
default:
break;
}
Expand Down
Loading

0 comments on commit 75fb6ec

Please sign in to comment.