% \iffalse
% --------------------------------------------------------------------
% <*utils>
% \fi
% 
% \subsubsection{VASSAL icons}
%
%
%  Some icons that may be useful in VASSAL.  We put them here so they
%  may be used in manuals and the like too. 
%
%
% First, the line style 
%    \begin{macrocode}
\tikzset{
  trash can line/.style={scale line widths,scale rounded corners,
    line width=.5mm,->},
}
%    \end{macrocode}
%
% Then, the body and lid of a trash can.
% 
%    \begin{macrocode}
\tikzset{
  trash can body/.pic={%
    \path[fill=black,scale line widths,scale rounded corners,
    rounded corners=.05cm]
    (-.3,.2) --++(.6,0) --++(-.1,-.7) --++(-.4,0) --cycle;
    \path[fill=white]
    (-.025,-.4) arc(180:360:.025) --++(   0,.5) arc(0:180:.025)   --cycle;
    \path[fill=white]
    (-.125,-.4) arc(180:360:.025) --++(-.07,.5) arc(0:180:.025) --cycle;
    \path[fill=white]
    ( .075,-.4) arc(180:360:.025) --++( .07,.5) arc(0:180:.025) --cycle;
  },
  trash can lid/.pic={%
    \path[fill=black,scale line widths,scale rounded corners,
    rounded corners=.05cm]
    (-.35,.23)--++(.7,0)--++(-.07,.07)--++(-.56,0)--cycle;
    \path[fill=black]
    (-.15,.3) --++(.05,0) --++(0,.05) --++(.2,0) --++(0,-.05)
    --++(.05,0) --++(0,.05) arc(0:90:.05) --++(-.2,0) arc(90:180:.05)
    --cycle;
  },
}
%    \end{macrocode}
%
% Then, a closed and open trash can
% 
%    \begin{macrocode}
\tikzset{
  trash can/.pic={
    \pic{trash can body};
    \pic{trash can lid};
  },
  trash can open/.pic={
    \pic{trash can body};
    \pic[rotate=-30] at (0,.1) {trash can lid};
  },
}
%    \end{macrocode}
%
% Now we can use that to generate some useful icons.
% 
%    \begin{macrocode}
\tikzset{
  eliminate icon/.pic={
    \pic{trash can open};
    \draw[trash can line,color=red!50!black]
    (-.5,.2) to[looseness=1.5] (-.1,.23);
  },
  restore icon/.pic={
    \pic{trash can open};
    \draw[trash can line,<-,color=green!50!black]
    (-.5,.2) to[looseness=1.5] (-.1,.23);
  },
  pool icon/.pic={
    \pic{trash can};
  },
}
%    \end{macrocode}
%
% These icons does not use the trash can picture. 
% 
%    \begin{macrocode}
\tikzset{
  flip icon/.pic={
    \draw[scale line widths,scale rounded corners,
    line width=1mm,->,color=blue!50!black]
    (-.5,-.5) arc(180:0:.5);% (.5,-.5);
  },
  pics/oob icon/.style n args={2}{code={%
      \begin{scope}[box/.style args={##1,##2,##3,##4}{
          minimum width=##1cm,
          minimum height=##2cm,
          fill=##3,
          anchor=##4,
          draw=gray!50!black,
          scale line widths,
          line width=.5pt,
          transform shape},
        under/.style={
          below=.05cm of ##1}
        ]
        \node[box={.5,.2,#1,north west,fill=#1}] (r1) at (.05,.45) {};
        \node[under=r1.south west,box={.3,.25,#1,north west}] (r2) {};
        \node[under=r2.south west,box={.2,.3, #1,north west}] (r3) {};
        \node[box={.2,.4,#2,north east}] (l1) at (-.05,.45) {};
      \end{scope}
    }
  }
}      
%    \end{macrocode}
%
% \iffalse
% --------------------------------------------------------------------
% </utils>
% \fi