-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement non-truncating structure overlays
- Loading branch information
Showing
22 changed files
with
588 additions
and
75 deletions.
There are no files selected for viewing
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
3 changes: 3 additions & 0 deletions
3
data/scenarios/Testing/1780-structure-merge-expansion/00-ORDER.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
nonoverlapping-structure-merge.yaml | ||
root-map-expansion.yaml | ||
structure-composition.yaml |
61 changes: 61 additions & 0 deletions
61
data/scenarios/Testing/1780-structure-merge-expansion/nonoverlapping-structure-merge.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
version: 1 | ||
name: Expansion of a substructure to fit its placements | ||
description: | | ||
Define two structures and place them on the map. | ||
robots: | ||
- name: base | ||
loc: [4, -4] | ||
dir: east | ||
known: [water, sand, tree] | ||
world: | ||
palette: | ||
'.': [grass] | ||
upperleft: [-1, 1] | ||
structures: | ||
- name: vertical rectangle | ||
structure: | ||
palette: | ||
'x': [blank, tree] | ||
map: | | ||
xx | ||
xx | ||
xx | ||
xx | ||
- name: horizontal rectangle | ||
structure: | ||
palette: | ||
'x': [blank, sand] | ||
map: | | ||
xxxx | ||
xxxx | ||
- name: disjoint rectangles | ||
structure: | ||
palette: | ||
'x': [blank, water] | ||
map: | | ||
xx | ||
xx | ||
placements: | ||
- src: vertical rectangle | ||
truncate: false | ||
offset: [-7, 7] | ||
- src: horizontal rectangle | ||
truncate: false | ||
offset: [7, -7] | ||
placements: | ||
- src: disjoint rectangles | ||
offset: [2, -2] | ||
map: | | ||
............... | ||
............... | ||
............... | ||
............... | ||
............... | ||
............... | ||
............... | ||
............... | ||
............... | ||
............... | ||
............... | ||
............... | ||
............... |
34 changes: 34 additions & 0 deletions
34
data/scenarios/Testing/1780-structure-merge-expansion/root-map-expansion.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
version: 1 | ||
name: Non-overlapping merging with expansion | ||
description: | | ||
Define two structures and place them on the map. | ||
Demonstrates automatic expansion of the root map grid. | ||
robots: | ||
- name: base | ||
loc: [8, 0] | ||
dir: east | ||
known: [tree, sand, water] | ||
world: | ||
palette: | ||
'.': [grass] | ||
'i': [ice] | ||
'j': [dirt] | ||
'k': [stone] | ||
'l': [stone, sand] | ||
'm': [stone, water] | ||
upperleft: [3, 3] | ||
structures: | ||
- name: single tree | ||
structure: | ||
palette: | ||
'x': [blank, tree] | ||
map: | | ||
x | ||
placements: | ||
- src: single tree | ||
truncate: false | ||
offset: [-2, -4] | ||
map: | | ||
i. | ||
.j |
111 changes: 111 additions & 0 deletions
111
data/scenarios/Testing/1780-structure-merge-expansion/structure-composition.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
version: 1 | ||
name: Various structure merging arrangements | ||
description: | | ||
Define two structures and place them on the map. | ||
robots: | ||
- name: base | ||
loc: [11, 0] | ||
dir: east | ||
known: [water, sand] | ||
world: | ||
palette: | ||
'.': [grass] | ||
upperleft: [-1, 1] | ||
structures: | ||
- name: vertical rectangle | ||
structure: | ||
palette: | ||
'x': [blank, water] | ||
map: | | ||
xx | ||
xx | ||
xx | ||
xx | ||
- name: horizontal rectangle | ||
structure: | ||
palette: | ||
'x': [blank, sand] | ||
map: | | ||
xxxx | ||
xxxx | ||
- name: combined rectangles blank base | ||
structure: | ||
palette: | ||
'x': [blank] | ||
map: | | ||
xxxx | ||
xxxx | ||
xxxx | ||
xxxx | ||
placements: | ||
- src: vertical rectangle | ||
- src: horizontal rectangle | ||
- name: combined rectangles empty base | ||
structure: | ||
palette: | ||
'x': [blank] | ||
map: "" | ||
placements: | ||
- src: vertical rectangle | ||
truncate: false | ||
- src: horizontal rectangle | ||
truncate: false | ||
- name: combined rectangles single cell base | ||
structure: | ||
palette: | ||
'x': [blank] | ||
map: | | ||
x | ||
placements: | ||
- src: vertical rectangle | ||
truncate: false | ||
- src: horizontal rectangle | ||
truncate: false | ||
- name: multi overlap | ||
structure: | ||
palette: | ||
'x': [blank] | ||
map: | | ||
xxxx | ||
placements: | ||
- src: vertical rectangle | ||
offset: [1, 0] | ||
truncate: false | ||
- src: horizontal rectangle | ||
truncate: false | ||
offset: [0, -2] | ||
- src: vertical rectangle | ||
offset: [3, -2] | ||
truncate: false | ||
- src: horizontal rectangle | ||
truncate: false | ||
offset: [3, -4] | ||
- src: vertical rectangle | ||
offset: [5, -4] | ||
truncate: false | ||
placements: | ||
- src: vertical rectangle | ||
offset: [1, -1] | ||
- src: horizontal rectangle | ||
offset: [1, -1] | ||
- src: multi overlap | ||
offset: [1, -6] | ||
truncate: false | ||
- src: combined rectangles blank base | ||
offset: [6, -1] | ||
- src: combined rectangles empty base | ||
offset: [11, -1] | ||
- src: combined rectangles single cell base | ||
offset: [11, -6] | ||
map: | | ||
................ | ||
................ | ||
................ | ||
................ | ||
................ | ||
................ | ||
................ | ||
................ | ||
................ | ||
................ | ||
................ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
#!/bin/bash -ex | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
cd $SCRIPT_DIR/.. | ||
cd $(git rev-parse --show-toplevel) | ||
|
||
# See https://github.com/swarm-game/swarm/issues/936 | ||
STACK_WORK=.stack-work-test stack test --fast "$@" | ||
cabal test -O0 -j "$@" |
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
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
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
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
Oops, something went wrong.