public PawnReplacedFigure PawnReplaceRequest() { string folder = GetStylePath(); var paths = new string[4]; if (board.WhoseMove == ChessLogic.Color.Black) { paths[0] = "bQ.png"; paths[1] = "bN.png"; paths[2] = "bR.png"; paths[3] = "bB.png"; } else { paths[0] = "wQ.png"; paths[1] = "wN.png"; paths[2] = "wR.png"; paths[3] = "wB.png"; } var toReturn = new FigureReference(PawnReplacedFigure.Queen); var window = new PawnReplace(folder, paths, ref toReturn); window.ShowDialog(); return(toReturn.replacedFigure); }
public PawnReplace(string pathFolder, string[] imgs, ref FigureReference toReturn) { InitializeComponent(); img1.Source = BitmapFrame.Create(new Uri(pathFolder + imgs[0])); img2.Source = BitmapFrame.Create(new Uri(pathFolder + imgs[1])); img3.Source = BitmapFrame.Create(new Uri(pathFolder + imgs[2])); img4.Source = BitmapFrame.Create(new Uri(pathFolder + imgs[3])); this.toReturn = toReturn; }