Improve typechecking for the new terrain macros.

This commit is contained in:
Eric S. Raymond 2010-09-23 11:45:58 +00:00
parent b16c17b03c
commit 901dc65fc6
3 changed files with 10 additions and 10 deletions

View file

@ -346,7 +346,7 @@
# Simplified macro for defining ImagePathFunction-using variations of water
# terrains. Assumes 15 frames, sets flag to "base" and layer to "-1000".
#define ANIMATED_WATER_15 TERRAIN IPF TIME IMAGESTEM
#define ANIMATED_WATER_15 TERRAINLIST IPF TIME IMAGESTEM
[terrain_graphics]
map="
, *
@ -357,7 +357,7 @@
[tile]
pos=1
type={TERRAIN}
type={TERRAINLIST}
set_no_flag=base
[/tile]
@ -372,7 +372,7 @@
# Simplified macro for defining ImagePathFunction-using water transitions.
# Note: the animations are disabled for now.
#define ANIMATED_WATER_15_TRANSITION TERRAIN ADJACENT LAYER IPF TIME IMAGESTEM
#define ANIMATED_WATER_15_TRANSITION TERRAINLIST ADJACENT LAYER IPF TIME IMAGESTEM
[terrain_graphics]
map="
, 2
@ -387,7 +387,7 @@
[/tile]
[tile]
pos=2
type={TERRAIN}
type={TERRAINLIST}
[/tile]
rotations=n,ne,se,s,sw,nw

View file

@ -29,7 +29,7 @@
[/terrain_graphics]
#enddef
#define NEW:FOREST TERRAIN ADJACENT IMAGESTEM
#define NEW:FOREST TERRAINLIST ADJACENT IMAGESTEM
# This assumes centered images. Places the images named
# {IMAGESTEM}-small[1-11].png on all {TERRAIN} adjacent to {ADJACENT}, and
# {IMAGESTEM}[1-11].png on all others.
@ -43,7 +43,7 @@
, *"
[tile]
pos=1
type={TERRAIN}
type={TERRAINLIST}
no_flag=forest
set_flag=forest,small_forest
[/tile]
@ -73,7 +73,7 @@
, *"
[tile]
pos=1
type={TERRAIN}
type={TERRAINLIST}
set_no_flag=forest
[/tile]
@ -240,4 +240,4 @@
center=90,144
[/image]
[/terrain_graphics]
#enddef
#enddef

View file

@ -165,7 +165,7 @@ def formaltype(f):
ftype = "range"
elif f in ("ALIGN",):
ftype = "alignment"
elif f in ("TYPES",):
elif f in ("TYPES"):
ftype = "types"
elif f.startswith("ADJACENT") or f.startswith("TERRAINLIST") or f == "RESTRICTING":
ftype = "terrain_pattern"
@ -173,7 +173,7 @@ def formaltype(f):
ftype = "terrain_code"
elif f in ("NAME", "NAMESPACE", "VAR", "IMAGESTEM", "ID", "FLAG", "BUILDER") or f.endswith("_NAME") or f.endswith("_ID") or f.endswith("_VAR"):
ftype = "name"
elif f in ("ID_STRING", "NAME_STRING", "DESCRIPTION"):
elif f in ("ID_STRING", "NAME_STRING", "DESCRIPTION", "IPF"):
ftype = "optional_string"
elif f in ("STRING", "TYPE", "TEXT") or f.endswith("_STRING") or f.endswith("_TYPE") or f.endswith("_TEXT"):
ftype = "string"