private void recUnite3J1_Click(object sender, MouseButtonEventArgs e) { if (Choix.Contains(123)) { Choix.Remove(123); recUnite3J1.ToolTip = "Cliquez ici pour choisir votre unité."; imgUnite3J1.Visibility = Visibility.Hidden; btnOk.IsEnabled = false; btnOk.Opacity = 0.5; } else { if (Choix.Count < NbCible) { Choix.Add(123); recUnite3J1.ToolTip = "Vous avez choisi cette unité, cliquez pour l'enlever des cibles."; imgUnite3J1.Visibility = Visibility.Visible; if (Choix.Count == NbCible) { btnOk.IsEnabled = true; btnOk.Opacity = 1; } } } }
public void InitialisationChoixAvecLibelleVide() { var test = new Choix("", 2); // TODO : Cas d'erreur, libellé vide Assert.Fail("Non implémenté"); }
private void recChoixJoueur1_Click(object sender, MouseButtonEventArgs e) { if (Choix.Contains(100)) { Choix.Remove(100); recChoixJoueur1.ToolTip = "Cliquez ici pour vous choisir."; imgChoixJoueur1.Visibility = Visibility.Hidden; btnOk.IsEnabled = false; btnOk.Opacity = 0.5; } else { if (Choix.Count < NbCible) { Choix.Add(100); recChoixJoueur1.ToolTip = "Vous vous ciblez, cliquez pour l'enlever des cibles."; imgChoixJoueur1.Visibility = Visibility.Visible; if (Choix.Count == NbCible) { btnOk.IsEnabled = true; btnOk.Opacity = 1; } } } }
private void Button_Click(object sender, RoutedEventArgs e) { Button b = sender as Button; switch (b.Name) { case ("Button_D"): Choix.Navigate(new Menu3Items(TypeFormule.Dejeuner)); break; case ("Button_Din"): Choix.Navigate(new Menu3Items(TypeFormule.Diner)); break; case ("Button_PD"): Choix.Navigate(new Menu2Items(TypeFormule.PetitDejeuner)); break; case ("Button_G"): Choix.Navigate(new Menu2Items(TypeFormule.Gouter)); break; case ("Button_C"): this.NavigationService.Navigate(new Catalog()); break; } }
public static void OnMessage(object sender, MessageEventArgs e) { // Debug.Log(e.Data); string s1 = e.Data; string s2 = "RESSOURCES"; bool b = s1.Contains(s2); if (b == true) { var ressourcesPlayer = JsonUtility.FromJson <RessourcesPlayer>(e.Data); quantiteCristaux = ressourcesPlayer.pierre; quantiteGraines = ressourcesPlayer.graine; quantiteFruits = ressourcesPlayer.fruit; idPlayer = ressourcesPlayer.id; sendPlayer = ressourcesPlayer.sendPlayer; } Connexion.ConnexionVerif(e.Data); PlayerMovement.Joystick(e.Data); PlayerMovement2.Joystick(e.Data); PlayerMovement3.Joystick(e.Data); PlayerMovement5.Joystick(e.Data); PlayerMovement.Jump(e.Data); PlayerMovement2.Jump(e.Data); PlayerMovement3.Jump(e.Data); PlayerMovement5.Jump(e.Data); PlayerMovement.Plante(e.Data); PlayerMovement2.Plante(e.Data); PlayerMovement3.Plante(e.Data); PlayerMovement5.Plante(e.Data); PlayerMovement.Recolte(e.Data); PlayerMovement2.Recolte(e.Data); PlayerMovement3.Recolte(e.Data); PlayerMovement5.Recolte(e.Data); PlayerMovement.PluieButton(e.Data); PlayerMovement2.PluieButton(e.Data); PlayerMovement3.PluieButton(e.Data); PlayerMovement5.PluieButton(e.Data); IsWalkingAnimation.JoystickAnimation(e.Data); IsWalkingAnimation2.JoystickAnimation(e.Data); IsWalkingAnimation3.JoystickAnimation(e.Data); IsWalkingAnimation5.JoystickAnimation(e.Data); IsWalkingAnimation.JumpAnimation(e.Data); IsWalkingAnimation2.JumpAnimation(e.Data); IsWalkingAnimation3.JumpAnimation(e.Data); IsWalkingAnimation5.JumpAnimation(e.Data); IsWalkingAnimation.PlanteAnimation(e.Data); IsWalkingAnimation2.PlanteAnimation(e.Data); IsWalkingAnimation3.PlanteAnimation(e.Data); IsWalkingAnimation5.PlanteAnimation(e.Data); IsWalkingAnimation.RecolteAnimation(e.Data); IsWalkingAnimation2.RecolteAnimation(e.Data); IsWalkingAnimation3.RecolteAnimation(e.Data); IsWalkingAnimation5.RecolteAnimation(e.Data); Choix.Voiture(e.Data); Choix.Rosalie(e.Data); SettingsMenu.Quit(e.Data); Jardinage.PluieButton(e.Data); }
private void recBatiment4J2_Click(object sender, MouseButtonEventArgs e) { if (Choix.Contains(214)) { Choix.Remove(214); recBatiment4J2.ToolTip = "Cliquez ici pour choisir ce bâtiment de votre adversaire."; imgBatiment4J2.Visibility = Visibility.Hidden; btnOk.IsEnabled = false; btnOk.Opacity = 0.5; } else { if (Choix.Count < NbCible) { Choix.Add(214); recBatiment4J2.ToolTip = "Vous avez choisi ce bâtiment, cliquez pour l'enlever des cibles."; imgBatiment4J2.Visibility = Visibility.Visible; if (Choix.Count == NbCible) { btnOk.IsEnabled = true; btnOk.Opacity = 1; } } } }
public void InitialisationChoixAvecValeurNonValide() { var test = new Choix("Ciseaux", 3); // TODO : Cas d'erreur, valeur non valide Assert.Fail("Non implémenté"); }
public void AffronterUnAutreChoixMoinsFort() { var test = new Choix("Pierre", 0); var autre = new Choix("Papier", 1); var actual = autre.Affronter(test); Assert.AreEqual(1, actual); }
public void AffronterUnAutreChoixIdentique() { var test = new Choix("Pierre", 0); var autre = new Choix("Pierre", 0); var actual = test.Affronter(autre); Assert.AreEqual(0, actual); }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { var valid = new List <ValidationResult>(); if (Choix.Count(s => s.IsSelected) == 0) { valid.Add(new ValidationResult("Vous devez au moins un selectionner un restaurant", new[] { "Choix" })); } return(valid); }
public void AffronterUnAutreChoixPlusFort() { // Arrange var test = new Choix("Pierre", 0); var autre = new Choix("Papier", 1); // Act var actual = test.Affronter(autre); // Assert Assert.AreEqual(2, actual); }
public void ChoixOperation(Choix choix) { switch (choix) { case Choix.Addition: dlgOperation += Addition; break; case Choix.Soustraction: dlgOperation += Soustraction; break; } }
public int Calculer(int n1, int n2) { int calculer = 0; Choix unChoix = Choix.Addition; if (unChoix == Choix.Addition) { calculer = n1 + n2; } else { calculer = n1 - n2; } return(calculer); }
public string InfoBulleComplete(int index) { Choix choix = listeChoix[index]; string infobulleComplete = choix.infobulle; for (int j = 0; j < choix.retoursEffets.Count; j++) { if (choix.retoursEffets[j] != "" && choix.retoursEffets[j] != null) { choix.retoursEffets[j] = ModifsRetourEffets(choix.retoursEffets[j]); infobulleComplete += "\n" + choix.retoursEffets[j]; } } return(infobulleComplete); }
public ActionResult Index(Identite identite, Structure structure, Choix choix) { if (!ModelState.IsValid) { return(View("Index")); } using (IDal dal = new Dal()) { int idPresta = dal.CreerPrestation(identite, structure, choix); if (idPresta == -1) { ViewBag.ActionErreur = "nouvelle demande de prestation"; return(RedirectToAction("Index")); } FormsAuthentication.SetAuthCookie("utilisateur" + idPresta, false); string message = dal.MailDemandePresta(idPresta); MailMessage email = new MailMessage(); email.To.Add(identite.Email); email.CC.Add("*****@*****.**"); email.From = new MailAddress("*****@*****.**"); email.Subject = "Demande de prestation Origin's Krew"; email.IsBodyHtml = true; email.Body = message; SmtpClient client = new SmtpClient("smtp.ionos.fr", 587); client.EnableSsl = true; NetworkCredential credential = new NetworkCredential("*****@*****.**", "SKL-63119-bgnt"); client.Credentials = credential; try { client.Send(email); } catch (Exception e) { Console.WriteLine("Erreur : " + e); } return(RedirectToAction("RecapDemande", "DemandePresta", new { id = idPresta })); } }
public void ChoixOperation(Choix choix) { switch (choix) { case Choix.Addition: dOperation += Addition; break; case Choix.Soustraction: dOperation += Soustraction; break; case Choix.Multiplication: dOperation += Multiplication; break; case Choix.Division: dOperation += Division; break; } }
public void ChoixOperation(Choix choix) { //Choix unChoix = Choix.Addition; //if (unChoix == Choix.Addition) //{ // Console.WriteLine("True"); //} //else //{ // Console.WriteLine("False"); //} switch (choix) { case Choix.Addition: dlgOperation += Addition; break; case Choix.Soustraction: dlgOperation += Soustraction; break; } }
/// <summary> /// Évenement clique si l'utilisateur choisi la brique /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Btn_Click(object sender, EventArgs e) { if (sender as Button == BtnBrique) { choix = Choix.Brique; } if (sender as Button == BtnPlancher) { choix = Choix.Plancher; } if (sender as Button == BtnNuage) { choix = Choix.Nuage; } if (sender as Button == BtnCoin) { choix = Choix.Coin; } }
static async Task <Choix> LireChoix(CancellationToken jeton) { Console.Write("Votre choix? "); Choix choix = default; await Task.Run(() => { switch (LireTouche(jeton).Result) { case ConsoleKey.Q: choix = Choix.Quitter; break; case ConsoleKey.DownArrow: choix = Choix.Bas; break; case ConsoleKey.UpArrow: choix = Choix.Haut; break; case ConsoleKey.LeftArrow: choix = Choix.Gauche; break; case ConsoleKey.RightArrow: choix = Choix.Droite; break; default: choix = Choix.Rien; break; } }, jeton);//Task run with a cancelation token return(choix); }
public int CreerPrestation(Identite identite, Structure structure, Choix choix) { try { bdd.Prestations.Add(new Prestation { DateCreation = DateTime.Now, Prenom = identite.Prenom, Nom = identite.Nom, Email = identite.Email, Telephone = identite.Telephone, Type = structure.Type, NomStructure = structure.NomStructure, Pays = structure.Pays, Etat = structure.Etat, VilleEU = structure.VilleEU, VilleAutre = structure.VilleAutre, CodePostal = structure.CodePostal, ChoixPrestation = choix.ChoixPrestation, TempsPresta = choix.TempsPresta, Occurence = choix.Occurence, Initiation = choix.Initiation, Budget = choix.Budget, Date = choix.Date, DureeStage = choix.DureeStage, Niveau = choix.Niveau, InfoComplementaire = choix.InfoComplementaire }); bdd.SaveChanges(); return(bdd.Prestations.ToList().ElementAt(bdd.Prestations.Count() - 1).Id); }catch (Exception e) { Utils.Logger.Log("ERROR", "Erreur création de prestation : " + e); return(-1); } }
public StatModsTarget(Choix c) : base(15, false, TargetFlags.None) { choix = c; }
public void InitialisationChoixUsuel() { var test = new Choix("Ciseaux", 2); Assert.AreEqual("Ciseaux", test.Libelle); }
public int Affronter(Choix autre) => (3 + valeur - autre.valeur) % 3;
static void Main(string[] args) { string Choix; bool Vf = false; do//Choice between Flashing ot Random { Console.WriteLine("Quel sapin voulez-vous? (C)lignotant ou (R)andomLight?"); Choix = Console.ReadLine(); foreach (string RC in new[] { "C", "R" }) // Verif tab { Vf |= (Choix.ToUpper() == RC.ToUpper()); //R or C == true ? } if (Vf == false) // Not ... { Console.WriteLine("Serieux marquez pas autre chose ca marche pas..."); Console.WriteLine(); } } while (!Vf); ///////// Starting Values /////////// int LightNum; int SleepC; int SleepR; List <int> SapinHeight; List <int> SapinWidth; SapinHeight = new List <int>(); SapinWidth = new List <int>(); /////// Switch for Tree Types///////// switch (Choix.ToUpper()) { case "C": int x; // temp value for questions ////////// NB of Light Question////////// do { Console.WriteLine("Nombre de lumieres?(1-1275)"); while (int.TryParse(Console.ReadLine(), out x) == false) { ; } LightNum = x; } while (LightNum > 1276 ^ LightNum < 1); ///////Speed of Flashing Lights ///////// do { Console.WriteLine("Vitesse ?(Je conseille 25 a 75.. have fun tbh lol)"); while (int.TryParse(Console.ReadLine(), out x) == false) { ; } SleepC = x; } while (SleepC < 1); Console.CursorVisible = false; // invis cursor SetCursorsave(LightNum, ref SapinHeight, ref SapinWidth); ///////////////Begin//////////////////// Console.Clear(); ShowTree(); while (true) // flashing same number of lights forever~~~~~ { for (int i = 0; i < LightNum; i++) { Console.SetCursorPosition(SapinWidth[i], Console.CursorTop = (SapinHeight[i])); Color(); Console.SetCursorPosition(0, Console.CursorTop = 0); } Thread.Sleep(SleepC); } case "R": ////////////Speed of Rand Lights Appearing ///////// do { Console.WriteLine("Vitesse ?(Je conseille 25 a 75 ou sque vous voulez....)"); while (int.TryParse(Console.ReadLine(), out x) == false) { ; } SleepR = x; } while (SleepR < 1); ///////////////Begin//////////////////// Console.Clear(); Console.CursorVisible = false; ShowTree(); while (true) // random add light til forever~~~~~~ { SetCursorStar(); Color(); Thread.Sleep(SleepR); } } }