示例#1
0
        public MainWindow()
        {
            InitializeComponent();
            path = Environment.CurrentDirectory;
            Fileworker.SetPaths(path);

            imgBoard.ImageSource = BitmapFrame.Create(new Uri(path + "/images/background.png"));
            Icon = BitmapFrame.Create(new Uri(path + "/images/icon.png"));
            sp   = new SoundPlayer
            {
                SoundLocation = path + "\\sounds\\music.wav"
            };
            MenuOpen();
        }
示例#2
0
 private void DockClick(object sender, MouseButtonEventArgs e)
 {
     if (sender is DockPanel dock)
     {
         for (int i = 0; i < list.Count; i++)
         {
             if (dock == list[i])
             {
                 Fileworker.SaveData(TypeOfData.FigureStyle, i);
             }
         }
     }
     this.Close();
 }
示例#3
0
        public void DrawAllFigures(Figures[,] board)
        {
            int style = Fileworker.GetStyle();

            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    if (board[i, j] != Figures.Empty)
                    {
                        CreateFigure(i, j, board[i, j], style);
                    }
                }
            }
        }
示例#4
0
 private string GetStylePath()
 {
     return(Directory.GetDirectories(path + "\\images\\styles")[Fileworker.GetStyle()] + "\\");
 }
示例#5
0
 public void Set(ChessLogic.Point cell, Figures figure)
 {
     CreateFigure(cell.x, cell.y, figure, Fileworker.GetStyle());
 }