示例#1
0
        private void DoAITurn()
        {
            int            color    = this.position.ToMove;
            PlayerSelector selector = color == 0 ? this.blackSelector : this.whiteSelector;

            if (selector.SelectedPlayer == 0)
            {
                this.UpdateNodesSec(color, "Human", 3, 1000);
                return;
            }

            if (selector.SelectedPlayer == 1)
            {
                this.position.MakeMove(this.searcher.Search());
                this.UpdateNodesSec(color, "C#", this.searcher.QNodeCount + this.searcher.NodeCount, this.searcher.AllottedTime);
            }
            else if (selector.SelectedPlayer == 2)
            {
                //this.jscriptPlayer.Fen = this.position.GetFen();
                //this.position.MakeMove(this.jscriptPlayer.MakeMove());
                //this.UpdateNodesSec(color, "JS", this.jscriptPlayer.Nodes, this.jscriptPlayer.Time);
            }

            this.timer.Start();
        }
示例#2
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/wp7chess;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot       = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.TitlePanel       = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel")));
     this.ApplicationTitle = ((System.Windows.Controls.TextBlock)(this.FindName("ApplicationTitle")));
     this.PageTitle        = ((System.Windows.Controls.TextBlock)(this.FindName("PageTitle")));
     this.chessBoard       = ((wp7chess.ChessBoard)(this.FindName("chessBoard")));
     this.blackSelector    = ((wp7chess.PlayerSelector)(this.FindName("blackSelector")));
     this.whiteSelector    = ((wp7chess.PlayerSelector)(this.FindName("whiteSelector")));
     this.whiteNodesTitle  = ((System.Windows.Controls.TextBlock)(this.FindName("whiteNodesTitle")));
     this.blackNodesTitle  = ((System.Windows.Controls.TextBlock)(this.FindName("blackNodesTitle")));
     this.blackNodesSec    = ((System.Windows.Controls.TextBlock)(this.FindName("blackNodesSec")));
     this.whiteNodesSec    = ((System.Windows.Controls.TextBlock)(this.FindName("whiteNodesSec")));
 }