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
This source diff could not be displayed because it is too large. You can view the blob instead.

namespace Wanderer.view
{
partial class FormJeu
{
/// <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(FormJeu));
this.pbAide = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
this.lblMarcheur = new System.Windows.Forms.Label();
this.lblArgent = new System.Windows.Forms.Label();
this.lblJoueur = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.pbPersonnes = new System.Windows.Forms.PictureBox();
this.btnUsine = new System.Windows.Forms.Button();
this.btnTrain = new System.Windows.Forms.Button();
this.btnRefuge = new System.Windows.Forms.Button();
this.btnChemin = new System.Windows.Forms.Button();
this.btnClub = new System.Windows.Forms.Button();
this.mapView1 = new Wanderer.view.Controls.MapView();
<<<<<<< HEAD
=======
this.panel2 = new System.Windows.Forms.Panel();
this.mapView2 = new Wanderer.view.Controls.MapView();
>>>>>>> 2b8dc33bbbc8993d8ee4e50bbbba1b8060f37418
((System.ComponentModel.ISupportInitialize)(this.pbAide)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbPersonnes)).BeginInit();
<<<<<<< HEAD
=======
this.panel2.SuspendLayout();
>>>>>>> 2b8dc33bbbc8993d8ee4e50bbbba1b8060f37418
this.SuspendLayout();
//
// pbAide
//
this.pbAide.Image = ((System.Drawing.Image)(resources.GetObject("pbAide.Image")));
this.pbAide.Location = new System.Drawing.Point(11, 12);
this.pbAide.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pbAide.Name = "pbAide";
this.pbAide.Size = new System.Drawing.Size(61, 52);
this.pbAide.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pbAide.TabIndex = 0;
this.pbAide.TabStop = false;
this.pbAide.Click += new System.EventHandler(this.pictureBox1_Click);
//
// panel1
//
this.panel1.Controls.Add(this.lblMarcheur);
this.panel1.Controls.Add(this.lblArgent);
this.panel1.Controls.Add(this.lblJoueur);
this.panel1.Controls.Add(this.pictureBox1);
this.panel1.Controls.Add(this.pbAide);
this.panel1.Controls.Add(this.pbPersonnes);
this.panel1.Location = new System.Drawing.Point(39, 10);
this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1624, 74);
this.panel1.TabIndex = 1;
//
// lblMarcheur
//
this.lblMarcheur.AutoSize = true;
this.lblMarcheur.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
<<<<<<< HEAD
this.lblMarcheur.Location = new System.Drawing.Point(1085, 24);
this.lblMarcheur.Name = "lblMarcheur";
this.lblMarcheur.Size = new System.Drawing.Size(105, 25);
=======
this.lblMarcheur.Location = new System.Drawing.Point(1447, 30);
this.lblMarcheur.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblMarcheur.Name = "lblMarcheur";
this.lblMarcheur.Size = new System.Drawing.Size(132, 29);
>>>>>>> 2b8dc33bbbc8993d8ee4e50bbbba1b8060f37418
this.lblMarcheur.TabIndex = 14;
this.lblMarcheur.Text = "Marcheurs";
//
// lblArgent
//
this.lblArgent.AutoSize = true;
this.lblArgent.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
<<<<<<< HEAD
this.lblArgent.Location = new System.Drawing.Point(868, 24);
this.lblArgent.Name = "lblArgent";
this.lblArgent.Size = new System.Drawing.Size(70, 25);
=======
this.lblArgent.Location = new System.Drawing.Point(1157, 30);
this.lblArgent.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblArgent.Name = "lblArgent";
this.lblArgent.Size = new System.Drawing.Size(87, 29);
>>>>>>> 2b8dc33bbbc8993d8ee4e50bbbba1b8060f37418
this.lblArgent.TabIndex = 13;
this.lblArgent.Text = "Argent";
//
// lblJoueur
//
this.lblJoueur.AutoSize = true;
this.lblJoueur.Font = new System.Drawing.Font("Microsoft Sans Serif", 30F);
<<<<<<< HEAD
this.lblJoueur.Location = new System.Drawing.Point(541, 10);
this.lblJoueur.Name = "lblJoueur";
this.lblJoueur.Size = new System.Drawing.Size(142, 46);
=======
this.lblJoueur.Location = new System.Drawing.Point(721, 12);
this.lblJoueur.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblJoueur.Name = "lblJoueur";
this.lblJoueur.Size = new System.Drawing.Size(179, 58);
>>>>>>> 2b8dc33bbbc8993d8ee4e50bbbba1b8060f37418
this.lblJoueur.TabIndex = 12;
this.lblJoueur.Text = "Joueur";
this.lblJoueur.Click += new System.EventHandler(this.label1_Click);
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
<<<<<<< HEAD
this.pictureBox1.Location = new System.Drawing.Point(831, 19);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 33);
=======
this.pictureBox1.Location = new System.Drawing.Point(1108, 23);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(43, 41);
>>>>>>> 2b8dc33bbbc8993d8ee4e50bbbba1b8060f37418
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 11;
this.pictureBox1.TabStop = false;
//
// pbPersonnes
//
this.pbPersonnes.Image = ((System.Drawing.Image)(resources.GetObject("pbPersonnes.Image")));
this.pbPersonnes.Location = new System.Drawing.Point(1397, 23);
this.pbPersonnes.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.pbPersonnes.Name = "pbPersonnes";
this.pbPersonnes.Size = new System.Drawing.Size(43, 41);
this.pbPersonnes.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pbPersonnes.TabIndex = 10;
this.pbPersonnes.TabStop = false;
//
// btnUsine
//
this.btnUsine.BackColor = System.Drawing.Color.Transparent;
this.btnUsine.FlatAppearance.BorderSize = 2;
this.btnUsine.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUsine.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.btnUsine.ForeColor = System.Drawing.Color.White;
this.btnUsine.Image = ((System.Drawing.Image)(resources.GetObject("btnUsine.Image")));
this.btnUsine.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnUsine.Location = new System.Drawing.Point(1440, 742);
this.btnUsine.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnUsine.Name = "btnUsine";
this.btnUsine.Size = new System.Drawing.Size(223, 95);
this.btnUsine.TabIndex = 5;
this.btnUsine.Text = "Usine";
this.btnUsine.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnUsine.UseVisualStyleBackColor = false;
this.btnUsine.Click += new System.EventHandler(this.btnUsine_Click);
//
// btnTrain
//
this.btnTrain.BackColor = System.Drawing.Color.Transparent;
this.btnTrain.FlatAppearance.BorderSize = 2;
this.btnTrain.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTrain.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.btnTrain.ForeColor = System.Drawing.Color.White;
this.btnTrain.Image = ((System.Drawing.Image)(resources.GetObject("btnTrain.Image")));
this.btnTrain.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnTrain.Location = new System.Drawing.Point(1092, 742);
this.btnTrain.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnTrain.Name = "btnTrain";
this.btnTrain.Size = new System.Drawing.Size(223, 95);
this.btnTrain.TabIndex = 6;
this.btnTrain.Text = "Train";
this.btnTrain.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnTrain.UseVisualStyleBackColor = false;
this.btnTrain.Click += new System.EventHandler(this.button1_Click);
//
// btnRefuge
//
this.btnRefuge.BackColor = System.Drawing.Color.Transparent;
this.btnRefuge.FlatAppearance.BorderSize = 2;
this.btnRefuge.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRefuge.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.btnRefuge.ForeColor = System.Drawing.Color.White;
this.btnRefuge.Image = ((System.Drawing.Image)(resources.GetObject("btnRefuge.Image")));
this.btnRefuge.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnRefuge.Location = new System.Drawing.Point(39, 742);
this.btnRefuge.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnRefuge.Name = "btnRefuge";
this.btnRefuge.Size = new System.Drawing.Size(223, 95);
this.btnRefuge.TabIndex = 7;
this.btnRefuge.Text = "Refuge";
this.btnRefuge.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnRefuge.UseVisualStyleBackColor = false;
this.btnRefuge.Click += new System.EventHandler(this.btnRefuge_Click);
//
// btnChemin
//
this.btnChemin.BackColor = System.Drawing.Color.Transparent;
this.btnChemin.FlatAppearance.BorderSize = 2;
this.btnChemin.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnChemin.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.btnChemin.ForeColor = System.Drawing.Color.White;
this.btnChemin.Image = ((System.Drawing.Image)(resources.GetObject("btnChemin.Image")));
this.btnChemin.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnChemin.Location = new System.Drawing.Point(375, 742);
this.btnChemin.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnChemin.Name = "btnChemin";
this.btnChemin.Size = new System.Drawing.Size(223, 95);
this.btnChemin.TabIndex = 8;
this.btnChemin.Text = "Chemins";
this.btnChemin.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnChemin.UseVisualStyleBackColor = false;
//
// btnClub
//
this.btnClub.BackColor = System.Drawing.Color.Transparent;
this.btnClub.FlatAppearance.BorderSize = 2;
this.btnClub.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnClub.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
this.btnClub.ForeColor = System.Drawing.Color.White;
this.btnClub.Image = ((System.Drawing.Image)(resources.GetObject("btnClub.Image")));
this.btnClub.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnClub.Location = new System.Drawing.Point(741, 742);
this.btnClub.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnClub.Name = "btnClub";
this.btnClub.Size = new System.Drawing.Size(223, 95);
this.btnClub.TabIndex = 9;
this.btnClub.Text = "Club";
this.btnClub.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.btnClub.UseVisualStyleBackColor = false;
//
// mapView1
//
this.mapView1.AutoScroll = true;
this.mapView1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("mapView1.BackgroundImage")));
this.mapView1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.mapView1.ColumnCount = 2;
this.mapView1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.mapView1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.mapView1.Location = new System.Drawing.Point(39, 128);
this.mapView1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.mapView1.Name = "mapView1";
this.mapView1.RowCount = 2;
this.mapView1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 13.81032F));
this.mapView1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 86.18968F));
this.mapView1.Size = new System.Drawing.Size(1624, 601);
this.mapView1.TabIndex = 11;
this.mapView1.Paint += new System.Windows.Forms.PaintEventHandler(this.mapView1_Paint);
//
<<<<<<< HEAD
=======
// panel2
//
this.panel2.Controls.Add(this.mapView2);
this.panel2.Location = new System.Drawing.Point(53, 93);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(650, 258);
this.panel2.TabIndex = 12;
//
// mapView2
//
this.mapView2.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("mapView2.BackgroundImage")));
this.mapView2.ColumnCount = 2;
this.mapView2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.mapView2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.mapView2.Location = new System.Drawing.Point(3, 3);
this.mapView2.Name = "mapView2";
this.mapView2.RowCount = 2;
this.mapView2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.mapView2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.mapView2.Size = new System.Drawing.Size(783, 321);
this.mapView2.TabIndex = 0;
//
>>>>>>> 2b8dc33bbbc8993d8ee4e50bbbba1b8060f37418
// FormJeu
//
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.ClientSize = new System.Drawing.Size(1707, 862);
this.Controls.Add(this.panel2);
this.Controls.Add(this.mapView1);
this.Controls.Add(this.btnClub);
this.Controls.Add(this.btnChemin);
this.Controls.Add(this.btnRefuge);
this.Controls.Add(this.btnTrain);
this.Controls.Add(this.btnUsine);
this.Controls.Add(this.panel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "FormJeu";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FormJeu";
((System.ComponentModel.ISupportInitialize)(this.pbAide)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbPersonnes)).EndInit();
<<<<<<< HEAD
=======
this.panel2.ResumeLayout(false);
>>>>>>> 2b8dc33bbbc8993d8ee4e50bbbba1b8060f37418
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PictureBox pbAide;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnUsine;
private System.Windows.Forms.Button btnTrain;
private System.Windows.Forms.Button btnRefuge;
private System.Windows.Forms.Button btnChemin;
private System.Windows.Forms.Button btnClub;
private System.Windows.Forms.PictureBox pbPersonnes;
private Controls.MapView mapView1;
private System.Windows.Forms.Label lblJoueur;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label lblMarcheur;
private System.Windows.Forms.Label lblArgent;
private System.Windows.Forms.Panel panel2;
private Controls.MapView mapView2;
}
}
\ 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 FormJeu : Form
{
private int currentPlayerIndex = 0;
int tailleTerritoire;
int nombreTour;
int bonusCh = 0;//bonus Chemin
int bonusCl = 0; //bonus Club
int marks = 40;
int randonneurs = 0;
const int limiteRandonneur = 100;
const int limiteTerritoire = 200;
int[] tbCouts = new int[] { 30, 10, 15, 10, 60 }; //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()
{
foreach (Object o in Controls)
{
if (o is Button b && b.Tag != null)
{
if (tbCouts[Convert.ToInt32(b.Tag)] > marks)
{
b.Enabled = false;
b.BackColor = Color.Gray;
}
else
{
b.Enabled = true;
b.BackColor = Color.Transparent;
}
//Premier tour
if(nombreTour==1)
{
b.Enabled = false;
b.BackColor = Color.Gray;
btnTrain.Enabled = true;
btnTrain.BackColor = Color.Transparent;
}
}
}
//Désactive train
if (nombreTour > 1)
{
btnTrain.BackColor = Color.Gray;
btnTrain.Enabled = 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)
{
Button b = (Button)sender;
Int32 i = Convert.ToInt32(b.Tag);
int cout = tbCouts[i];
int gain = tbGains[i];
//Calcul des marks et randonneurs, ajout d'image sur la map
if (marks >= cout && MapView.SelectedTile.model.Improvement == 0)
{
MapView.SelectedTile.model.Improvement = (Improvement) i;
if (!MapView.SelectedTile.model.HasChanged) return;
MapView.SelectedTile.model.Owner = Game.Instance.Players[currentPlayerIndex];
tbConstruct[i]++;
if (tbConstruct[1] % 5 ==0 && tbConstruct[1]!=0)
{
bonusCh += 1;
}
if (tbConstruct[2] % 5 == 0 && tbConstruct[2] != 0)
{
bonusCl += 2;
}
marks -= cout-gain-10;
randonneurs += tbRandonneur[i]+bonusCh+bonusCl;
if (randonneurs < 0)
{
randonneurs = 0;
}
update();
}
}
/**
* Mise à jour des Lables et du MapView
**/
private void update()
{
currentPlayerIndex = (currentPlayerIndex + 1) % Game.Instance.Players.Count;
lblArgent.Text = "Argent :" + marks;
lblMarcheur.Text = "Marcheurs : " + randonneurs;
lblTour.Text = "Nombre d'action : " + nombreTour++;
if (MapView.SelectedTile != null && MapView.SelectedTile.model.HasChanged)
{
MapView.SelectedTile.Image = image();
MapView.SelectedTile.model.HasChanged = false;
}
updateButtons();
}
public void updateTailleTerritoire(int nombreClub, int nombreChemins, int nombreRefuges)
{
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);
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)
{
}
}
}