Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test and schema update for toplevel mask #2085

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/scenarios/Testing/00-ORDER.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ Achievements
1533-sow-command.yaml
1533-sow-seed-maturation.yaml
231-requirements
2085-toplevel-mask.yaml
45 changes: 45 additions & 0 deletions data/scenarios/Testing/2085-toplevel-mask.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: 1
name: Toplevel palette mask
description: |
Demo equivalence of 'blank' terrain and
the 'mask' property for producing transparent cells.
seed: 0
objectives:
- goal:
- |
`grab` a `flower`{=entity}.
condition: |
as base {has "flower"};
solution: |
move; move; grab;
robots:
- name: base
dir: east
devices:
- treads
- logger
- grabber
known: [water, flower]
world:
dsl: |
overlay [
{grass},
mask ((x + y) % 2 == 0) {flower}
]
upperleft: [-4, 4]
offset: false
mask: x
palette:
'B': [stone, erase, base]
'.': [stone, erase]
'y': [blank]
map: |-
yyy...xxx
y.......x
y.......x
.........
....Bxxxx
.........
x.......y
x.......y
xxx...yyy
4 changes: 4 additions & 0 deletions data/schema/world.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
"type": "boolean",
"description": "Whether players are allowed to scroll the world map."
},
"mask": {
"type": "string",
"description": "A special palette character that indicates that map cell should be transparent"
},
"palette": {
"type": "object",
"examples": [{"T": ["grass", "tree"]}],
Expand Down
1 change: 1 addition & 0 deletions test/integration/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ testScenarioSolutions rs ui key =
, testSolution Default "Testing/1642-biomes"
, testSolution (Sec 10) "Testing/1533-sow-command"
, testSolution Default "Testing/1533-sow-seed-maturation"
, testSolution Default "Testing/2085-toplevel-mask"
, testGroup
-- Note that the description of the classic world in
-- data/worlds/classic.yaml (automatically tested to some
Expand Down
Loading