Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes

namespace Wanderer.view
{
partial class FormAide
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAide));
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.lblTexte = new System.Windows.Forms.Label();
this.btnConstruction = new System.Windows.Forms.Button();
this.btnContexte = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.btnGagner = new System.Windows.Forms.Button();
this.lblTitre = new System.Windows.Forms.Label();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(1050, 635);
this.button1.Margin = new System.Windows.Forms.Padding(2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(184, 56);
this.button1.TabIndex = 0;
this.button1.Text = "Reprendre le jeu";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 35.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(531, 18);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(118, 56);
this.label1.TabIndex = 1;
this.label1.Text = "Aide";
//
// lblTexte
//
this.lblTexte.AutoSize = true;
this.lblTexte.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblTexte.Location = new System.Drawing.Point(2, 0);
this.lblTexte.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTexte.Name = "lblTexte";
this.lblTexte.Size = new System.Drawing.Size(62, 25);
this.lblTexte.TabIndex = 2;
this.lblTexte.Text = "Texte";
//
// btnConstruction
//
this.btnConstruction.BackColor = System.Drawing.Color.Transparent;
this.btnConstruction.FlatAppearance.BorderSize = 2;
this.btnConstruction.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.btnConstruction.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnConstruction.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnConstruction.ForeColor = System.Drawing.Color.White;
this.btnConstruction.Location = new System.Drawing.Point(11, 295);
this.btnConstruction.Margin = new System.Windows.Forms.Padding(2);
this.btnConstruction.Name = "btnConstruction";
this.btnConstruction.Size = new System.Drawing.Size(159, 63);
this.btnConstruction.TabIndex = 4;
this.btnConstruction.Text = "Construction";
this.btnConstruction.UseVisualStyleBackColor = false;
this.btnConstruction.Click += new System.EventHandler(this.button2_Click);
//
// btnContexte
//
this.btnContexte.BackColor = System.Drawing.Color.Transparent;
this.btnContexte.FlatAppearance.BorderSize = 2;
this.btnContexte.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.btnContexte.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnContexte.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnContexte.ForeColor = System.Drawing.Color.White;
this.btnContexte.Location = new System.Drawing.Point(11, 213);
this.btnContexte.Margin = new System.Windows.Forms.Padding(2);
this.btnContexte.Name = "btnContexte";
this.btnContexte.Size = new System.Drawing.Size(159, 65);
this.btnContexte.TabIndex = 5;
this.btnContexte.Text = "Contexte historique";
this.btnContexte.UseVisualStyleBackColor = false;
this.btnContexte.Click += new System.EventHandler(this.btnContexte_Click);
this.btnContexte.MouseHover += new System.EventHandler(this.btnContexte_MouseHover);
//
// button4
//
this.button4.BackColor = System.Drawing.Color.Transparent;
this.button4.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button4.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button4.ForeColor = System.Drawing.Color.White;
this.button4.Location = new System.Drawing.Point(834, 635);
this.button4.Margin = new System.Windows.Forms.Padding(2);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(164, 56);
this.button4.TabIndex = 6;
this.button4.Text = "Quitter";
this.button4.UseVisualStyleBackColor = false;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// btnGagner
//
this.btnGagner.BackColor = System.Drawing.Color.Transparent;
this.btnGagner.FlatAppearance.BorderSize = 2;
this.btnGagner.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.btnGagner.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnGagner.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnGagner.ForeColor = System.Drawing.Color.White;
this.btnGagner.Location = new System.Drawing.Point(11, 382);
this.btnGagner.Margin = new System.Windows.Forms.Padding(2);
this.btnGagner.Name = "btnGagner";
this.btnGagner.Size = new System.Drawing.Size(159, 67);
this.btnGagner.TabIndex = 7;
this.btnGagner.Text = "Comment gagner ?";
this.btnGagner.UseVisualStyleBackColor = false;
this.btnGagner.Click += new System.EventHandler(this.btnGagner_Click);
//
// lblTitre
//
this.lblTitre.AutoSize = true;
this.lblTitre.BackColor = System.Drawing.Color.Transparent;
this.lblTitre.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F);
this.lblTitre.ForeColor = System.Drawing.Color.White;
this.lblTitre.Location = new System.Drawing.Point(225, 131);
this.lblTitre.Name = "lblTitre";
this.lblTitre.Size = new System.Drawing.Size(85, 39);
this.lblTitre.TabIndex = 8;
this.lblTitre.Text = "Titre";
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.lblTexte);
this.flowLayoutPanel1.Location = new System.Drawing.Point(203, 197);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(974, 406);
this.flowLayoutPanel1.TabIndex = 9;
//
// FormAide
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(1280, 720);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.lblTitre);
this.Controls.Add(this.btnGagner);
this.Controls.Add(this.button4);
this.Controls.Add(this.btnContexte);
this.Controls.Add(this.btnConstruction);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "FormAide";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Aide";
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblTexte;
private System.Windows.Forms.Button btnConstruction;
private System.Windows.Forms.Button btnContexte;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button btnGagner;
private System.Windows.Forms.Label lblTitre;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Wanderer.view
{
public partial class FormAide : Form
{
public FormAide()
{
InitializeComponent();
lblTitre.Text = "Contexte historique";
lblTexte.Text = "Nous sommes en 1875, toute l’Allemagne connaît une grande période d’industrialisation. De ce fait, la démographie du pays se voit exploser, les villes se remplissent et" +
"rapidement beaucoup souhaitent s’échapper de la ville et se ressourcer à la nature.\n\n" +
"Quelle autre bonne manière de le faire que de s’essayer à la randonnée!\n\n" +
"Ainsi, c’est votre rôle, en tant que ministre allemand, de développer au plus rapidement votre territoire dans ce domaine pour battre les autres régions dans la course à l’aménagement" +
" de votre région, pour que chacun de ces habitants puisse s’épanouir à son gré sur les chemins de randonnée.";
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
}
private void button2_Click(object sender, EventArgs e)
{
Button b = (Button)sender;
lblTitre.Text = b.Text;
lblTexte.Text = "En début de partie vous aurez le choix de l'endroit où vous voulez construire votre gare. Celle ci doit etre placée en bord de terrain.\n\n" +
"Afin d'augmenter le nombre de marcheurs sur votre terrain vous devrez placer :\n" +
" - des usines : pour fabriquer du matériel de randonnée, et donc gagner de l'argent\n" +
" - des chemins : pour augmenter la superficie de votre territoire de randonnée\n" +
" - des refuges : pour attirer plus de marcheur \n\n" +
"Vous aurez également la possibilité de financer des clubs de randonnées et d'améliorer vos chemins ferroviaires afin d'attirer plus de randonneurs.\n\n" +
"Lorsque vous placez 5 chemins vous obtiendrez un bonus d'un marcheur à chaque nouveau chemin placé, de deux marcheurs si vous en placez etc. Il en est de" +
" meme avec les clubs mais le bonus est doublé !\n\n"+
"Pour placer les différents éléments, cliquez sur la case où vous voulez vous placer puis cliquez sur l'item que vous voulez placer dans cette case.";
}
private void btnContexte_Click(object sender, EventArgs e)
{
Button b = (Button)sender;
lblTitre.Text = b.Text;
lblTexte.Text = "Nous sommes en 1875, toute l’Allemagne connaît une grande période d’industrialisation. De ce fait, la démographie du pays se voit exploser, les villes se remplissent et" +
"rapidement beaucoup souhaitent s’échapper de la ville et se ressourcer à la nature.\n\n"+
"Quelle autre bonne manière de le faire que de s’essayer à la randonnée!\n\n"+
"Ainsi, c’est votre rôle, en tant que ministre allemand, de développer au plus rapidement votre territoire dans ce domaine pour battre les autres régions dans la course à l’aménagement" +
" de votre région, pour que chacun de ces habitants puisse s’épanouir à son gré sur les chemins de randonnée.";
}
private void button4_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void btnGagner_Click(object sender, EventArgs e)
{
Button b = (Button)sender;
lblTitre.Text = b.Text;
lblTexte.Text = "Vous devrez atteindre un nombre de 50 marcheurs sur votre territoire avant votre adversaire.\n\n"+
"Pour cela aménagez votre territoire ! \n" +
"(Rendez-vous dans la rubrique Construction)";
}
private void btnContexte_MouseHover(object sender, EventArgs e)
{
}
}
}
This diff is collapsed.

namespace Wanderer.view
{
partial class FormFin
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormFin));
this.label1 = new System.Windows.Forms.Label();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.lblWinner = new System.Windows.Forms.Label();
this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel();
this.lblLooser = new System.Windows.Forms.Label();
this.lblTour = new System.Windows.Forms.Label();
this.btnContexte = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.flowLayoutPanel1.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(409, 61);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(363, 46);
this.label1.TabIndex = 0;
this.label1.Text = "Le joueur a gagné !";
this.label1.Click += new System.EventHandler(this.label1_Click);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.lblWinner);
this.flowLayoutPanel1.Font = new System.Drawing.Font("Microsoft Tai Le", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.flowLayoutPanel1.Location = new System.Drawing.Point(164, 183);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(369, 220);
this.flowLayoutPanel1.TabIndex = 1;
//
// lblWinner
//
this.lblWinner.AutoSize = true;
this.lblWinner.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblWinner.Location = new System.Drawing.Point(3, 0);
this.lblWinner.Name = "lblWinner";
this.lblWinner.Size = new System.Drawing.Size(64, 25);
this.lblWinner.TabIndex = 0;
this.lblWinner.Text = "label2";
//
// flowLayoutPanel2
//
this.flowLayoutPanel2.Controls.Add(this.lblLooser);
this.flowLayoutPanel2.Font = new System.Drawing.Font("Microsoft Tai Le", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.flowLayoutPanel2.Location = new System.Drawing.Point(785, 192);
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.Size = new System.Drawing.Size(366, 204);
this.flowLayoutPanel2.TabIndex = 2;
//
// lblLooser
//
this.lblLooser.AutoSize = true;
this.lblLooser.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblLooser.Location = new System.Drawing.Point(3, 0);
this.lblLooser.Name = "lblLooser";
this.lblLooser.Size = new System.Drawing.Size(64, 25);
this.lblLooser.TabIndex = 0;
this.lblLooser.Text = "label3";
//
// lblTour
//
this.lblTour.AutoSize = true;
this.lblTour.BackColor = System.Drawing.Color.Transparent;
this.lblTour.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblTour.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblTour.ForeColor = System.Drawing.Color.White;
this.lblTour.Location = new System.Drawing.Point(446, 462);
this.lblTour.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTour.Name = "lblTour";
this.lblTour.Size = new System.Drawing.Size(406, 46);
this.lblTour.TabIndex = 3;
this.lblTour.Text = "Nombre de tour total :";
//
// btnContexte
//
this.btnContexte.BackColor = System.Drawing.Color.Transparent;
this.btnContexte.FlatAppearance.BorderSize = 2;
this.btnContexte.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.btnContexte.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnContexte.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnContexte.ForeColor = System.Drawing.Color.White;
this.btnContexte.Location = new System.Drawing.Point(732, 602);
this.btnContexte.Margin = new System.Windows.Forms.Padding(2);
this.btnContexte.Name = "btnContexte";
this.btnContexte.Size = new System.Drawing.Size(159, 65);
this.btnContexte.TabIndex = 6;
this.btnContexte.Text = "Quitter";
this.btnContexte.UseVisualStyleBackColor = false;
this.btnContexte.Click += new System.EventHandler(this.btnContexte_Click);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.FlatAppearance.BorderSize = 2;
this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(374, 602);
this.button1.Margin = new System.Windows.Forms.Padding(2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(159, 65);
this.button1.TabIndex = 7;
this.button1.Text = "Rejouer";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// FormFin
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(1280, 700);
this.Controls.Add(this.button1);
this.Controls.Add(this.btnContexte);
this.Controls.Add(this.lblTour);
this.Controls.Add(this.flowLayoutPanel2);
this.Controls.Add(this.flowLayoutPanel1);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(2);
this.Name = "FormFin";
this.Text = "Fin";
this.Load += new System.EventHandler(this.FormFin_Load);
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.flowLayoutPanel2.ResumeLayout(false);
this.flowLayoutPanel2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Label lblWinner;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
private System.Windows.Forms.Label lblLooser;
private System.Windows.Forms.Label lblTour;
private System.Windows.Forms.Button btnContexte;
private System.Windows.Forms.Button button1;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Wanderer.controller;
using Wanderer.model;
using Wanderer.view.Controls;
namespace Wanderer.view
{
public partial class FormFin : Form
{
public FormFin(Player currentPlayer, int nombreTour)
{
InitializeComponent();
CenterToScreen();
if (currentPlayer.Color == Color.Brown)
{
label1.Text = "Le joueur Rouge a gagné !";
label1.BackColor = currentPlayer.Color;
}
else
{
label1.Text = "Le joueur Bleu a gagné !";
label1.BackColor = currentPlayer.Color;
}
lblTour.Text = lblTour.Text + nombreTour;
afficheResultat(currentPlayer);
}
private void label1_Click(object sender, EventArgs e)
{
}
private void afficheResultat(Player p)
{
lblWinner.Text = "Marcheurs : " + p.randonneurs +
"\n\nMarks : " + p.marks;
flowLayoutPanel1.BackColor = p.Color;
Game.Instance.currentPlayerIndex = (Game.Instance.currentPlayerIndex + 1) % Game.Instance.Players.Count;
Player p2= Game.Instance.Players[Game.Instance.currentPlayerIndex];
lblLooser.Text = "Marcheurs : " + p2.randonneurs +
"\n\nMarks : " + p2.marks;
flowLayoutPanel2.BackColor = p2.Color;
}
private void FormFin_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
FormJeu f = new FormJeu();
f.Show();
this.Hide();
}
private void btnContexte_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
This diff is collapsed.
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Wanderer.controller;
using Wanderer.model;
using Wanderer.view.Controls;
namespace Wanderer.view
{
public partial class FormJeu : Form
{
int nombreTour=-1;
const int limiteRandonneur = 100;
const int limiteTerritoire = 200;
//TODO enlever bonus +10 quand une usine est build
int[] tbCouts = new int[] { 30, 10, 35, 15, 100 }; //Refuge,Chemin,Club,Train,Usine
int[] tbGains = new int[] { 5, 0, 0, 0, 10 };
int[] tbRandonneur = new[] { 3, 2, 6, 0, -10 };
int[] tbConstruct = new int[]{0, 0, 0, 0, 0}; //Refuge,Chemin,Club,Train,Usine
/**
* Action updateButtons()
* - vérifie si fond suffisant pour les éléments
* - si oui, enable + fond transparent
* - si non, disable + fond gris
* - premier tour grise tout sauf btn Train
* */
public void updateButtons()
{
Player currentPlayer = Game.Instance.Players[Game.Instance.currentPlayerIndex];
foreach (Object o in Controls)
{
if (o is Button b && b.Tag != null)
{
if (tbCouts[Convert.ToInt32(b.Tag)] > currentPlayer.marks)
{
b.Enabled = false;
b.BackColor = Color.Gray;
}
else
{
b.Enabled = true;
b.BackColor = Color.Transparent;
}
//Premier tour
if(nombreTour==0)
{
b.Visible = false;
btnTrain.Visible = true;
}
else
{
b.Visible = true;
btnTrain.Visible = false;
}
}
}
if (nombreTour % 10 ==0 && nombreTour != 0)
{
for( int i=0; i < tbConstruct.Length; i++)
{
if(i!=1)
tbCouts[i] += 5;
}
}
}
private void updateLabels()
{
foreach (Object o in Controls)
{
if (o is Label l && l.Tag != null)
{
//Premier tour
if (nombreTour == 0)
{
l.Visible = false;
lblTrain.Visible = true;
}
else
{
l.Visible = true;
lblTrain.Visible = false;
}
}
}
}
/**
* Action btnClick
* - vérifie si fond suffisant
* - mise en place de l'image
* - calculs des bonus des chemins et club
* - lance update()
**/
private void btn_Click(object sender, EventArgs e)
{
Player currentPlayer = Game.Instance.Players[Game.Instance.currentPlayerIndex];
Button b = (Button)sender;
Int32 i = Convert.ToInt32(b.Tag);
int cout = tbCouts[i];
currentPlayer.gain += tbGains[i];
//Calcul des marks et randonneurs, ajout d'image sur la map
if (currentPlayer.marks >= cout && MapView.SelectedTile != null && MapView.SelectedTile.model.Improvement == 0)
{
MapView.SelectedTile.model.Improvement = (Improvement) i;
if (!MapView.SelectedTile.model.HasChanged) return;
MapView.SelectedTile.model.Owner = currentPlayer;
tbConstruct[i]++;
if (tbConstruct[1] % 5 ==0 && tbConstruct[1]!=0)
{
currentPlayer.bonusCh += 1;
}
if (tbConstruct[2] % 5 == 0 && tbConstruct[2] != 0)
{
currentPlayer.bonusCl += 2;
}
currentPlayer.marks -= cout- currentPlayer.gain - 10;
currentPlayer.randonneurs += tbRandonneur[i]+currentPlayer.bonusCh+currentPlayer.bonusCl;
if (currentPlayer.randonneurs < 0)
{
currentPlayer.randonneurs = 0;
}
update();
}
}
/**
* Mise à jour des Lables et du MapView
**/
private void update()
{
Player currentPlayer = Game.Instance.Players[Game.Instance.currentPlayerIndex];
lblRefuge.Text = tbCouts[0].ToString();
lblChemins.Text = tbCouts[1].ToString();
lblClub.Text = tbCouts[2].ToString();
lblTrain.Text = tbCouts[3].ToString();
lblUsine.Text = tbCouts[4].ToString();
if (Game.Instance.currentPlayerIndex == 0)
{
lblArgentRouge.Text = "Argent :" + currentPlayer.marks;
lblMarcheurRouge.Text = "Marcheurs : " + currentPlayer.randonneurs;
nombreTour++;
}
if (Game.Instance.currentPlayerIndex == 1)
{
lblArgentBleu.Text = "Argent :" + currentPlayer.marks;
lblMarcheurBleu.Text = "Marcheurs : " + currentPlayer.randonneurs;
}
lblTour.Text = "Nombre d'action : " + nombreTour;
if (MapView.SelectedTile != null && MapView.SelectedTile.model.HasChanged)
{
MapView.SelectedTile.Image = image();
MapView.SelectedTile.BackColor = MapView.SelectedTile.model.Owner.Color;
MapView.SelectedTile.model.HasChanged = false;
}
updateButtons();
updateLabels();
if (currentPlayer.randonneurs >= 50)
{
FormFin f = new FormFin(currentPlayer,nombreTour);
f.Show();
this.Hide();
}
Game.Instance.currentPlayerIndex = (Game.Instance.currentPlayerIndex + 1) % Game.Instance.Players.Count;
currentPlayer = Game.Instance.Players[Game.Instance.currentPlayerIndex];
lblTour.ForeColor = currentPlayer.Color;
}
public void updateTailleTerritoire(int nombreClub, int nombreChemins, int nombreRefuges)
{
Player currentPlayer = Game.Instance.Players[Game.Instance.currentPlayerIndex];
currentPlayer.tailleTerritoire = nombreChemins * 5 + nombreRefuges * 10;
}
public void disable()
{
this.Enabled = false;
}
public FormJeu()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
FormAide formAide = new FormAide();
formAide.Show();
}
private void FormJeu_Load(object sender, EventArgs e)
{
mapView1.Model = new Map(20, 10);
lblArgentBleu.Text = "Argent :" + 50;
lblMarcheurBleu.Text = "Marcheurs : " + 0;
update();
}
private void FormJeu_FormClosed(object sender, FormClosedEventArgs e)
{
Application.Exit();
}
public Image image()
{
switch (MapView.SelectedTile.model.Improvement)
{
case Improvement.Club:
return btnClub.Image;
case Improvement.Factory:
return btnUsine.Image;
case Improvement.Path:
return btnChemin.Image;
case Improvement.Refuge:
return btnRefuge.Image;
case Improvement.TrainStation:
return btnTrain.Image;
}
return null;
}
private void btnUsine_Click(object sender, EventArgs e)
{
}
private void btnTrain_Click(object sender, EventArgs e)
{
}
private void btnRefuge_Click(object sender, EventArgs e)
{
}
private void btnChemin_Click(object sender, EventArgs e)
{
}
private void btnClub_Click(object sender, EventArgs e)
{
}
private void mapView1_Paint(object sender, PaintEventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void mapView1_Click(object sender, EventArgs e)
{
}
}
}
This diff is collapsed.
namespace Wanderer
{
partial class FormMainMenu
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMainMenu));
this.btnPlay = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.btnAide = new System.Windows.Forms.Button();
this.lbltitre = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// btnPlay
//
this.btnPlay.BackColor = System.Drawing.Color.Transparent;
this.btnPlay.FlatAppearance.BorderSize = 3;
this.btnPlay.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.btnPlay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnPlay.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnPlay.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.btnPlay.Location = new System.Drawing.Point(637, 213);
this.btnPlay.Margin = new System.Windows.Forms.Padding(1);
this.btnPlay.Name = "btnPlay";
this.btnPlay.Size = new System.Drawing.Size(397, 158);
this.btnPlay.TabIndex = 0;
this.btnPlay.Text = "Jouer";
this.btnPlay.UseVisualStyleBackColor = false;
this.btnPlay.Click += new System.EventHandler(this.btnPlay_Click);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Transparent;
this.button1.FlatAppearance.BorderSize = 3;
this.button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button1.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.button1.Location = new System.Drawing.Point(637, 594);
this.button1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(397, 158);
this.button1.TabIndex = 1;
this.button1.Text = "Quitter";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// btnAide
//
this.btnAide.BackColor = System.Drawing.Color.Transparent;
this.btnAide.FlatAppearance.BorderSize = 3;
this.btnAide.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Moccasin;
this.btnAide.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAide.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnAide.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.btnAide.Location = new System.Drawing.Point(637, 400);
this.btnAide.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.btnAide.Name = "btnAide";
this.btnAide.Size = new System.Drawing.Size(397, 158);
this.btnAide.TabIndex = 2;
this.btnAide.Text = "Aide";
this.btnAide.UseVisualStyleBackColor = false;
this.btnAide.Click += new System.EventHandler(this.btnAide_Click);
//
// lbltitre
//
this.lbltitre.AutoSize = true;
this.lbltitre.BackColor = System.Drawing.Color.Transparent;
this.lbltitre.Font = new System.Drawing.Font("Microsoft Sans Serif", 70F);
this.lbltitre.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
this.lbltitre.Location = new System.Drawing.Point(511, 44);
this.lbltitre.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lbltitre.Name = "lbltitre";
this.lbltitre.Size = new System.Drawing.Size(568, 132);
this.lbltitre.TabIndex = 3;
this.lbltitre.Text = "Wanderer";
//
// FormMainMenu
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(1707, 862);
this.Controls.Add(this.lbltitre);
this.Controls.Add(this.btnAide);
this.Controls.Add(this.button1);
this.Controls.Add(this.btnPlay);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(1);
this.Name = "FormMainMenu";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "s";
this.Load += new System.EventHandler(this.FormMainMenu_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnPlay;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button btnAide;
private System.Windows.Forms.Label lbltitre;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Wanderer.controller;
using Wanderer.view;
namespace Wanderer
{
public partial class FormMainMenu : Form
{
public FormMainMenu()
{
InitializeComponent();
}
private void btnPlay_Click(object sender, EventArgs e)
{
FormJeu formJeu = new FormJeu();
Game.Instance = new Game();
this.Hide();
formJeu.Show();
}
private void button1_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void btnAide_Click(object sender, EventArgs e)
{
FormAide formAide = new FormAide();
formAide.Show();
}
private void FormMainMenu_Load(object sender, EventArgs e)
{
}
private void btnPlay_MouseEnter(object sender, EventArgs e)
{
Button btn = sender as Button;
btn.BackColor = Color.Yellow;
}
}
}
\ No newline at end of file
This diff is collapsed.