private void Button_Click2(object sender, RoutedEventArgs e) { WebBrowser wb = new WebBrowser(); string director = ((ComboBox)this.FindName("directorCbox")).Text; string season = ((ComboBox)this.FindName("seasonCbox")).Text; string production = ((ComboBox)this.FindName("productionCompanyCbox")).Text; string genre = ((ComboBox)this.FindName("genreCbox")).Text; string grade = ((ComboBox)this.FindName("gradeCbox")).Text; string distributor = ((ComboBox)this.FindName("distributorCbox")).Text; if (director == "" || season == "" || production == "" || genre == "" || grade == "" || distributor == "") { MessageBox.Show("You must fill in all of the fields!", "MOVE Error!", MessageBoxButton.OK, MessageBoxImage.Error); return; } RadioButton dicision = (RadioButton)this.FindName("dicisionTreeRbtn"); RadioButton covering = (RadioButton)this.FindName("coveringAlgoRbtn"); if (covering.IsChecked == true) { string s = Covering.get(director, season, production, genre, grade, distributor); MessageBoxResult b = MessageBox.Show(Covering.rule + "\n If you want to read whole rule\n Press yes button.", "Result", MessageBoxButton.YesNo, MessageBoxImage.Information); if (b == MessageBoxResult.Yes) { try { System.Diagnostics.Process.Start("http://uyu423.iptime.org/~vyujing/DM/i2.html"); } catch { } } } if (dicision.IsChecked == true) { string s = DecistionTree.get(director, season, production, genre, grade, distributor); MessageBoxResult b = MessageBox.Show(DecistionTree.rule, "Result", MessageBoxButton.YesNo, MessageBoxImage.Information); if (b == MessageBoxResult.Yes) { try { System.Diagnostics.Process.Start("http://uyu423.iptime.org/~vyujing/DM/i1.html"); } catch { } } } return; }
private void Start() { clock = FindObjectOfType <Clock>(); stopObjects += FindObjectOfType <BackgroundSoundController>().Stop; stopObjects += clock.PlayAlarm; stopObjects += FindObjectOfType <PauseButton>().Stop; stopObjects += FindObjectOfType <EyeBlinkController>().Stop; stopObjects += FindObjectOfType <Monster>().Stop; covering = FindObjectOfType <Covering>(); camAnimation = FindObjectOfType <CamAnimation>(); }
public Chocolate(string name, double weight, double sugar, Filling filling = Filling.none, Covering chocolate = Covering.none) { if (name != null) { this.Name = name; } else { this.Name = "chocolate" + count; count++; } this.Weigth = weight; this.Sugar = sugar; this.FillingOfSweet = filling; this.Chocolate = chocolate; }
private void Button_Click(object sender, RoutedEventArgs e) { Label l = (Label)this.FindName("resultLbl"); string director = ((ComboBox)this.FindName("directorCbox")).Text; string season = ((ComboBox)this.FindName("seasonCbox")).Text; string production = ((ComboBox)this.FindName("productionCompanyCbox")).Text; string genre = ((ComboBox)this.FindName("genreCbox")).Text; string grade = ((ComboBox)this.FindName("gradeCbox")).Text; string distributor = ((ComboBox)this.FindName("distributorCbox")).Text; if (director == "" || season == "" || production == "" || genre == "" || grade == "" || distributor == "") { MessageBox.Show("You must fill in all of the fields!", "MOVE Error!", MessageBoxButton.OK, MessageBoxImage.Error); return; } RadioButton dicision = (RadioButton)this.FindName("dicisionTreeRbtn"); if (dicision.IsChecked == true) { l.Content = "Number of spectator : " + DecistionTree.get(director, season, production, genre, grade, distributor); Label a = (Label)this.FindName("accuracy"); a.Content = "Accuracy : 91.7073"; } RadioButton covering = (RadioButton)this.FindName("coveringAlgoRbtn"); if (covering.IsChecked == true) { l.Content = "Number of spectator : " + Covering.get(director, season, production, genre, grade, distributor); Label a = (Label)this.FindName("accuracy"); a.Content = "Accuracy : 82.7988"; } }
public XRegion(Region covering, bool[,] map) : base(covering) { //Available spawns are the center and the four points orthogonal to center just outside the X. PotentialSpawns[Spawns.Powerup].Add(new Region(Covering.Center, Covering.Center)); PotentialSpawns[Spawns.Waypoint].Add(new Region(Covering.Center, Covering.Center)); //Grab the first free map cell to the left of center. Location counter = Covering.Center.Left; while (map[counter.X, counter.Y] && Covering.Touches(counter, true, true, false)) { counter = counter.Left; if (counter.X < 0) { counter.X = map.GetLength(0) - 1; } } if (Covering.Touches(counter, true, true, false)) { PotentialSpawns[Spawns.Powerup].Add(new Region(counter, counter)); PotentialSpawns[Spawns.Waypoint].Add(new Region(counter, counter)); } //Right of center. counter = Covering.Center.Right; while (map[counter.X, counter.Y] && Covering.Touches(counter, true, true, false)) { counter = counter.Right; if (counter.X >= map.GetLength(0)) { counter.X = 0; } } if (Covering.Touches(counter, true, true, false)) { PotentialSpawns[Spawns.Powerup].Add(new Region(counter, counter)); PotentialSpawns[Spawns.Waypoint].Add(new Region(counter, counter)); } //Above center. counter = Covering.Center.Above; while (map[counter.X, counter.Y] && Covering.Touches(counter, true, true, false)) { counter = counter.Above; if (counter.Y < 0) { counter.Y = map.GetLength(1) - 1; } } if (Covering.Touches(counter, true, true, false)) { PotentialSpawns[Spawns.Powerup].Add(new Region(counter, counter)); PotentialSpawns[Spawns.Waypoint].Add(new Region(counter, counter)); } //Below center. counter = Covering.Center.Below; while (map[counter.X, counter.Y] && Covering.Touches(counter, true, true, false)) { counter = counter.Below; if (counter.Y >= map.GetLength(1)) { counter.Y = 0; } } if (Covering.Touches(counter, true, true, false)) { PotentialSpawns[Spawns.Powerup].Add(new Region(counter, counter)); PotentialSpawns[Spawns.Waypoint].Add(new Region(counter, counter)); } }