From 67c1011cfaaa2b63c9fb8ceb2f3d40c585514ccc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 8 Jun 2021 13:25:47 +0100 Subject: [PATCH] penultima: macroify colours Signed-off-by: Ian Jackson --- specs/penultima.game.toml | 45 ++++++++++++--------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/specs/penultima.game.toml b/specs/penultima.game.toml index fd6b3f34..0ad388ba 100644 --- a/specs/penultima.game.toml +++ b/specs/penultima.game.toml @@ -11,6 +11,16 @@ "ship","giraffe","cannon"] {% endmacro fairy_pieces -%} +{% macro one_colour(x, y, colour) %} +[[pieces]] +pos = [{{ x }}, {{ y }}] +type = "LibList" +lib = "wikimedia" +prefix = "chess-{{colour}}-" +items = ["K","Q","R","R","B","B","N","N"] +posd = [10, 0] +{% endmacro one_colour %} + # -------------------- actual game spec -------------------- @@ -141,37 +151,10 @@ count = 8 # exciting colours -[[pieces]] -pos = [210, 55] -type = "LibList" -lib = "wikimedia" -prefix = "chess-blue-" -items = ["K","Q","R","R","B","B","N","N"] -posd = [10, 0] - -[[pieces]] -pos = [210, 65] -type = "LibList" -lib = "wikimedia" -prefix = "chess-yellow-" -items = ["K","Q","R","R","B","B","N","N"] -posd = [10, 0] - -[[pieces]] -pos = [210, 75] -type = "LibList" -lib = "wikimedia" -prefix = "chess-red-" -items = ["K","Q","R","R","B","B","N","N"] -posd = [10, 0] - -[[pieces]] -pos = [210, 45] -type = "LibList" -lib = "wikimedia" -prefix = "chess-purple-" -items = ["K","Q","R","R","B","B","N","N"] -posd = [10, 0] +{{ m::one_colour(x=210, y=55, colour="blue" )}} +{{ m::one_colour(x=210, y=65, colour="yellow" )}} +{{ m::one_colour(x=210, y=75, colour="red" )}} +{{ m::one_colour(x=210, y=45, colour="purple" )}} # fairy pieces -- 2.30.2