blob: 05f721529725349ed795120b2bb232fcfc609ee3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
% \iffalse
% --------------------------------------------------------------------
%<*hex>
% \fi
%
% \subsubsection{Extra graphics}
% \label{sec:impl:hex:extra}
%
% To make the interface a bit more flexible we allow for adding
% arbitrary stuff to the hexes.
%
% Some examples of \spec{pic}tures to add in the \spec{extra} stuff.
%
% \begin{HexKey}{hex/fortress}
%
% Draw a fortress. An example of a extra graphics entity.
%
% \begin{macrocode}
\tikzset{%
hex/fortress/.pic={
\path[draw,pic actions]
(0: .9) --
(0: .7) --
(60: .7) -- ( 60:.9) -- ( 60:.7) --
(120:.7) -- (120:.9) -- (120:.7) --
(180:.7) -- (180:.9) -- (180:.7) --
(240:.7) -- (240:.9) -- (240:.7) --
(300:.7) -- (300:.9) -- (300:.7) --
(0: .7) -- cycle;}}
% \end{macrocode}
% \end{HexKey}
%
% \begin{HexKey}{hex/fortress 2}
%
% Draw a fortress. An example of a extra graphics entity.
%
% \begin{macrocode}
\tikzset{
hex/fortress 2/.pic={%
\draw[pic actions,transform shape] (0:0.64)
foreach \a in {15,45,...,345}{
--(\a:0.64)
--(\a:0.80)
--(\a+15:0.80)
--(\a+15:0.64)}
--cycle;
},
}
% \end{macrocode}
% \end{HexKey}
%
% \iffalse
% --------------------------------------------------------------------
% \fi
%
% \subsubsection{Some macros}
%
%
% \begin{macrocode}
\DeclareRobustCommand\fortmark[1][scale=.25]{\tikz[#1,transform shape]{%
\pic{hex/fortress 2}}}
\providecommand\terrainmark[2][scale=.2]{%
\tikz[#1]{\hex[label=,terrain=#2]}}
\providecommand\clearhex[1][scale=.2]{\tikz[#1]{\hex[label=]}}
\providecommand\woodshex[1][scale=.2]{\terrainmark[#1]{woods}}
\providecommand\mountainhex[1][scale=.2]{\terrainmark[#1]{mountains}}
\providecommand\cityhex[1][scale=.2]{\terrainmark[#1]{city}}
\providecommand\beachhex[1][scale=.2]{\terrainmark[#1]{beach}}
\providecommand\seahex[1][scale=.2]{\tikz[#1]{\hex[label=,fill=sea]}}
\providecommand\riverhex[1][scale=.2]{%
\tikz[#1]{%
\hex[label=](c=0,r=0)%
\river[](hex cs:e=SW)--(hex cs:e=NE);}}
\providecommand\roadhex[1][scale=.2]{%
\tikz[#1]{%
\hex[label=](c=0,r=0)%
\road(hex cs:e=SW)--(hex cs:e=NE);}}
% \end{macrocode}
%
% \iffalse
%</hex>
% --------------------------------------------------------------------
% \fi
|