use utf8;

my %CONS = ( # producing building
	r => ['pm'],
);
my %UNIT = ( # any unit
	m => ['pm'],
	s => ['pm'],
);
my %UNITF = ( # fighter
	p => ['pm'],
	h => ['pm'],
);
my %UNITA = (
	a => ['pm'],
);
my %UNITB = (
	b => ['ci'],
);
my %UNITH = (
	%UNITA,
	g => ['pm'],
	c => ['pm'],
);

{

'' => {
},

P => {
	%UNIT, %UNITH,
	b => ['me modePb'],
	v => ['me modePv'],
},
Pb => {
	n => ['mo modePbn'],
	p => ['me'],
	a => ['me'],
	g => ['mo modePbg'],
	f => ['mv modePbf'],
	c => ['me'],
	y => ['mv modePby'],
	b => ['me modePbb'],
},
Pbn => {
	%CONS,
	p => ['co modeP'],
},
Pbg => {
	%CONS,
	z => ['co'],
	d => ['cp'],
	t => ['cp modePbgt'],
	k => ['cp modePbgk'],
},
Pbgt => {
	%UNIT, %UNITF,
	t => ['ci'],
	l => ['ci'],
	r => ['cp'],
},
Pbgk => {
	%UNIT, %UNITF, %UNITA,
	r => ['cp modePbgkr'],
},
Pbgkr => {
	%UNIT, %UNITF,
	f => ['pm'],
	c => ['ci'],
	e => ['ci'],
},
Pbf => {
	w => ['mv'],
	a => ['mv'],
	s => ['mv'],
},
Pby => {
	w => ['mv'],
	a => ['mv'],
	s => ['mv'],
},
Pbb => {
	r => ['pm'],
},
Pv => {
	r => ['mo modePvr'],
	s => ['mo modePvs'],
	c => ['mv modePvc'],
	b => ['mv modePvb'],
	f => ['mv modePvf'],
	t => ['mv modePvt'],
	o => ['mv modePvo'],
	a => ['mv modePva'],
},
Pvr => {
	%CONS,
	s => ['co'],
	o => ['cp'],
	v => ['cp modePvrv'],
},
Pvrv => {
	%UNIT, %UNITF, %UNITA,
	r => ['co'],
},
Pvs => {
	%CONS,
	s => ['co'],
	c => ['cp modePvsc'],
	a => ['cp modePvsa'],
	o => ['co modePvso ext'],
},
Pvsc => {
	%UNIT, %UNITF, %UNITA,
	i => ['co'],
},
Pvsa => {
	%UNIT, %UNITF, %UNITA,
	r => [undef],
	t => [undef],
},
Pvso => {
	%UNIT, %UNITF, %UNITA,
	d => ['ci'],
},
Pvc => {
	l => ['mv'],
},
Pvb => {
	s => ['mv'],
	c => ['mv'],
	g => ['mv'],
},
Pvf => {
	a => ['mv'],
	g => ['mv'],
	c => ['mv'],
	d => ['mv ext'],
	j => ['mv'],
},
Pvt => {
	t => ['mv'],
	h => ['mv'],
	k => ['mv'],
#	c => ['mv'], #TODO
	e => ['mv'],
	t => ['mv'],
},
Pvo => {
	g => ['mv'],
	s => ['mv'],
},
Pva => {
	r => ['mv'],
	s => ['mv'],
	k => ['mv'],
},

Z => {
	d => ['co modeZd'],
	z => ['cp'],
	o => ['co modeZo'],
	h => ['cp modeZh'],
	q => ['mv modeZq'],
},
Zd => {
	%UNIT, %UNITH, %UNITB,
	b => ['me modeZdb'],
	v => ['me modeZdv'],
},
Zdb => {
	h => ['mo modeZdbh'],
	c => ['mo modeZdbc'],
	e => ['me'],
	s => ['mv modeZdbs'],
	v => ['mv modeZdbv'],
	d => ['mv modeZdbd'],
},
Zdbh => {
	%CONS,
	b => ['me'],
	s => ['pm modeZ'],
	l => ['mo modeZdbhl'],
},
Zdbhl => {
	%CONS,
	b => ['me'],
	v => ['mv'],
	a => ['mv'],
	p => ['mv'],
	h => ['mo modeZdbhlh'],
},
modeZdbhlh => {
	%CONS,
	b => ['me'],
	v => ['mv'],
	a => ['mv'],
	p => ['mv'],
},
Zdbs => {
	m => ['mv'],
	a => ['mv'],
},
Zdbv => {
	m => ['mv'],
	a => ['mv'],
	c => ['mv'],
},
Zdbd => {
	m => ['mv'],
	g => ['mv'],
	l => ['mv'],
},
Zdv => {
},

}
