public static String getNameFromPeuple(TypeUnite peuple) { String name = ""; switch (peuple) { case TypeUnite.Gaulois: name = "Gaulois"; break; case TypeUnite.Nain: name = "Nain"; break; case TypeUnite.Viking: name = "Viking"; break; } return name; }
public static SolidColorBrush getColorFromPeuple(TypeUnite peuple) { SolidColorBrush color = Brushes.Black; switch (peuple) { case TypeUnite.Gaulois: color = Brushes.Yellow; break; case TypeUnite.Nain: color = Brushes.SlateGray; break; case TypeUnite.Viking: color = Brushes.Purple; break; } return color; }
public void nouvellePartie(TypeCarte taille, TypeUnite typeJ1, TypeUnite typeJ2) { SmallWorld.Instance.carte = fabAutre.creerCarte(taille); SmallWorld.Instance.carte.initialiseVortexs(); SmallWorld.Instance.carte.print(); List<Joueur> joueurs = new List<Joueur>(); r = new Random(); SmallWorld.Instance.premierJoueur = r.Next(SmallWorld.NOMBRE_JOUEURS); SmallWorld.Instance.joueurCourant = SmallWorld.Instance.premierJoueur; Console.WriteLine("Premier joueur : " + SmallWorld.Instance.premierJoueur); joueurs.Add(fabAutre.creerJoueur(typeJ1, 0)); joueurs.Add(fabAutre.creerJoueur(typeJ2, 1)); SmallWorld.Instance.joueurs = joueurs; SmallWorld.Instance.nbTours = 0; int nombreUnites = SmallWorld.Instance.carte.getNombreUniteMax(); List<Coordonnee> posDepartJoueurs = SmallWorld.Instance.carte.getDepartJoueurs(); foreach (Joueur j in SmallWorld.Instance.joueurs) { switch (j.Peuple) { case TypeUnite.Gaulois: fabUnit = new FabriqueGaulois(); break; case TypeUnite.Viking: fabUnit = new FabriqueViking(); break; case TypeUnite.Nain: fabUnit = new FabriqueNain(); break; default: throw new Exception("Type unité non reconnue"); } for (int i = 0; i < nombreUnites; i++) { j.addUnite(fabUnit.fabriquerUnite(posDepartJoueurs[j.idJoueur])); } } }
public static BitmapImage getImageFromPeuple(TypeUnite peuple) { BitmapImage logo = new BitmapImage(); logo.BeginInit(); switch (peuple) { case TypeUnite.Gaulois: logo.UriSource = new Uri("pack://application:,,,/WPF;component/Ressources/gaulois.png"); break; case TypeUnite.Nain: logo.UriSource = new Uri("pack://application:,,,/WPF;component/Ressources/nain.png"); break; case TypeUnite.Viking: logo.UriSource = new Uri("pack://application:,,,/WPF;component/Ressources/viking.png"); break; } logo.EndInit(); return logo; }
private void j1Click(object sender, RoutedEventArgs e) { j1Gaulois.Style = this.FindResource("smallButton") as Style; j1Nain.Style = this.FindResource("smallButton") as Style; j1Viking.Style = this.FindResource("smallButton") as Style; Button clicked = (Button)sender; clicked.Style = this.FindResource("smallButtonActivated") as Style; switch (clicked.Name) { case "j1Gaulois": j1 = TypeUnite.Gaulois; break; case "j1Nain": j1 = TypeUnite.Nain; break; case "j1Viking": j1 = TypeUnite.Viking; break; } j2ButtonsActivate(); }
/** * Lance une nouvelle partie */ public void nouvellePartie(TypeCarte tailleCarte, TypeUnite j1, TypeUnite j2) { MonteurPartie monteur = new MonteurPartie(); monteur.nouvellePartie(tailleCarte, j1, j2); nbTourMax = SmallWorld.Instance.carte.getNombreTours(); }
public Joueur(TypeUnite t, int id) { Peuple = t; idJoueur = id; points = 0; }
public Joueur creerJoueur(TypeUnite peuple, int id) { return new Joueur(peuple, id); }
private void j2Click(object sender, RoutedEventArgs e) { j2Gaulois.Style = this.FindResource("smallButton") as Style; j2Nain.Style = this.FindResource("smallButton") as Style; j2Viking.Style = this.FindResource("smallButton") as Style; Button clicked = (Button)sender; clicked.Style = this.FindResource("smallButtonActivated") as Style; switch (clicked.Name) { case "j2Gaulois": j2 = TypeUnite.Gaulois; break; case "j2Nain": j2 = TypeUnite.Nain; break; case "j2Viking": j2 = TypeUnite.Viking; break; } valider.IsEnabled = true; }
public static extern void AfficherTypeUnite(TypeUnite v);
public static extern Erreur Renfort(TypeUnite quoi);
public static extern Erreur Deguisement(Position cible, TypeUnite nouveau_type);
public static extern Caracs Caracteristiques(TypeUnite tu);