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); } }
public void ShowCanPutInSign(UIElement uielement) { List <int> _tmp = StackP.CalculateCanPutInSign(uielement); for (int i = 0; i < _tmp.Count; i++) { ShowSign(_tmp[i]); } }
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()); }
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; }
public void AllClear() { StackP.AllClear(); }
public void Guess_hide() { StackP.Guess_hide(); }
public void Guess_show() { StackP.Guess_show(); }
//int k = 0; //void timer_Tick1(object sender, EventArgs e) //{ // k++; // if (k > 4) // { // sender as dis // } //} public bool IsLose() { return(StackP.IsLose()); }
public void addCheese(int key, UIElement uielement) { StackP.AddCheese(key, uielement); }