Added all figures so you can see what kind it was promoted from
[Shogi.git] / pjas.cpp
blobb69ccd2e0c0f4dab670326f77ee280fa84d4d6e1
1 #include "pjas.h"
3 /* typer
4 0 = bonde
5 1 = lans
6 2 = springare
7 3 = löpare
8 4 = torn
9 5 = silver
10 6 = guld
11 7 = kung
12 8 = prmotoed bonde
13 9 = prmotoed lans
14 10 = prmotoed springare
15 11 = prmotoed löpare
16 12 = prmotoed torn
17 13 = promoted silver
20 Pjas::Pjas(int type)
22 promoted = false;
23 ispromotable = true;
24 typ = type;
25 isking = false;
26 owner = 0;
27 outside = false;
28 xpos=-1;
29 ypos=-1;
30 if (typ == 6 || typ==7)
32 ispromotable = false;
33 if (typ == 7)
34 isking = true;
38 int Pjas::picture()
40 int Cowner;
41 if (owner==-1)
42 Cowner=0;
43 else
44 Cowner=1;
45 if (typ ==0) return Cowner*14+0;
46 else if (typ == 1) return Cowner*14+1;
47 else if (typ == 2) return Cowner*14+2;
48 else if (typ == 3) return Cowner*14+3;
49 else if (typ == 4) return Cowner*14+4;
50 else if (typ==5) return Cowner*14+5;
51 else if (typ==6) return Cowner*14+6;
52 else if (typ==7) return Cowner*14+7;
53 else if (typ==8) return Cowner*14+8;
54 else if (typ==9) return Cowner*14+9;
55 else if (typ==10) return Cowner*14+10;
56 else if (typ==11) return Cowner*14+11
57 else if (typ==12) return Cowner*14+12;
58 else return Cowner*14+13;