コード例 #1
0
ファイル: PlayBox.xaml.cs プロジェクト: nyarbouh/DavinciCode
        public bool LowAIGuess()
        {
            List <int> _tmp    = StackP.CatchUnpassCheese();
            var        _parent = (((this.Parent as Canvas).Parent as Grid).Parent as Class.DavinciCodePlay);

            int guessnum    = (_parent as Class.DavinciCodePlay).ran.Next(13);
            int CatchCheese = _tmp[(_parent as Class.DavinciCodePlay).ran.Next(_tmp.Count)];

            (StackP.MainSP.Children[CatchCheese] as Class.Cheese).Guess_in();
            addnum(CatchCheese, guessnum);

            DispatcherTimer timer = new DispatcherTimer();

            timer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            timer.Tick    += new EventHandler(timer_Tick);
            timer.Start();

            if (guessnum == (StackP.MainSP.Children[CatchCheese] as Class.Cheese).IconIndex)
            {
                (StackP.MainSP.Children[CatchCheese] as Class.Cheese).Pass = true;
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
ファイル: PlayBox.xaml.cs プロジェクト: nyarbouh/DavinciCode
        public void ShowCanPutInSign(UIElement uielement)
        {
            List <int> _tmp = StackP.CalculateCanPutInSign(uielement);

            for (int i = 0; i < _tmp.Count; i++)
            {
                ShowSign(_tmp[i]);
            }
        }
コード例 #3
0
ファイル: PlayBox.xaml.cs プロジェクト: nyarbouh/DavinciCode
        public void AIPutCheeseIntoPlayBox(UIElement uIElement)
        {
            var        _parent = (((this.Parent as Canvas).Parent as Grid).Parent as Class.DavinciCodePlay);
            List <int> _tmp    = StackP.CalculateCanPutInSign(uIElement);
            int        key     = (_parent as Class.DavinciCodePlay).ran.Next(_tmp.Count);

            ShowSign(_tmp[key]);
            //Sing_Click(SignButton[key], new RoutedEventArgs());
        }
コード例 #4
0
ファイル: PlayBox.xaml.cs プロジェクト: nyarbouh/DavinciCode
        public void AIGuessWrong(/*UIElement uIElement*/)
        {
            List <int> _tmp = StackP.CatchUnpassCheese();
            //(uIElement as Cheese).Pass = true;
            Random Ran = new Random();
            int    a   = _tmp[Ran.Next(_tmp.Count)];

            (StackP.MainSP.Children[a] as Class.Cheese).Pass  = true;
            (StackP.MainSP.Children[a] as Class.Cheese).Opera = true;
        }
コード例 #5
0
ファイル: PlayBox.xaml.cs プロジェクト: nyarbouh/DavinciCode
 public void AllClear()
 {
     StackP.AllClear();
 }
コード例 #6
0
ファイル: PlayBox.xaml.cs プロジェクト: nyarbouh/DavinciCode
 public void Guess_hide()
 {
     StackP.Guess_hide();
 }
コード例 #7
0
ファイル: PlayBox.xaml.cs プロジェクト: nyarbouh/DavinciCode
 public void Guess_show()
 {
     StackP.Guess_show();
 }
コード例 #8
0
ファイル: PlayBox.xaml.cs プロジェクト: nyarbouh/DavinciCode
        //int k = 0;
        //void timer_Tick1(object sender, EventArgs e)
        //{
        //    k++;
        //    if (k > 4)
        //    {
        //        sender as dis
        //    }
        //}

        public bool IsLose()
        {
            return(StackP.IsLose());
        }
コード例 #9
0
ファイル: PlayBox.xaml.cs プロジェクト: nyarbouh/DavinciCode
 public void addCheese(int key, UIElement uielement)
 {
     StackP.AddCheese(key, uielement);
 }