private void figuraZPojemnika(Pole figura) { if (figura.ZwrocGracza() == Gracz.BIALE) { pojemnikNaFigury1.Pop(); } else if (figura.ZwrocGracza() == Gracz.CZARNE) { pojemnikNaFigury2.Pop(); } }
private void zbitaFiguraDoPijemnika(Pole figura) { if (figura.ZwrocGracza() == Gracz.BIALE) { pojemnikNaFigury1.Push(figura); } else if (figura.ZwrocGracza() == Gracz.CZARNE) { pojemnikNaFigury2.Push(figura); } }
//metody /// <summary> /// Sprawdza czy pionek jest na swojej lini przemiany (dla bia³ych y=0, dla czarnych y=7) /// </summary> /// <param name="x">The x.</param> /// <param name="y">The y.</param> /// <param name="bierka">The bierka.</param> public void Sprawdz(int x, int y, Pole bierka) { czyPromocja = false; if (y == 0 && bierka.ZwrocGracza() == Gracz.BIALE && bierka is Pionek) { this.czyPromocja = true; } else if (y == 7 && bierka.ZwrocGracza() == Gracz.CZARNE && bierka is Pionek) { czyPromocja = true; } this.x = x; this.y = y; }
private BitmapImage zwrocPasjacyObrazek(Pole pole) { if (pole.ZwrocSymbol() != " ") { if (pole is Przelot) { return(obrazki[0]); } if (pole is Pionek && pole.ZwrocGracza() == Gracz.BIALE) { return(obrazki[0]); } else if (pole is Pionek && pole.ZwrocGracza() == Gracz.CZARNE) { return(obrazki[6]); } else if (pole is Skoczek && pole.ZwrocGracza() == Gracz.BIALE) { return(obrazki[1]); } else if (pole is Skoczek && pole.ZwrocGracza() == Gracz.CZARNE) { return(obrazki[7]); } else if (pole is Goniec && pole.ZwrocGracza() == Gracz.BIALE) { return(obrazki[2]); } else if (pole is Goniec && pole.ZwrocGracza() == Gracz.CZARNE) { return(obrazki[8]); } else if (pole is Wieza && pole.ZwrocGracza() == Gracz.BIALE) { return(obrazki[3]); } else if (pole is Wieza && pole.ZwrocGracza() == Gracz.CZARNE) { return(obrazki[9]); } else if (pole is Krol && pole.ZwrocGracza() == Gracz.BIALE) { return(obrazki[4]); } else if (pole is Krol && pole.ZwrocGracza() == Gracz.CZARNE) { return(obrazki[10]); } else if (pole is Hetman && pole.ZwrocGracza() == Gracz.BIALE) { return(obrazki[5]); } else if (pole is Hetman && pole.ZwrocGracza() == Gracz.CZARNE) { return(obrazki[11]); } } else { return(null); } return(null); }