diff --git a/fichier1/fichier1/Controllers/GameController.cs b/fichier1/fichier1/Controllers/GameController.cs index c11a3247df8bebe2ab984ebc505a13b1edbd2037..835b920aeff5aea71555c5098045c6487ca37fb6 100644 --- a/fichier1/fichier1/Controllers/GameController.cs +++ b/fichier1/fichier1/Controllers/GameController.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using fichier1.Model; namespace fichier1.Controllers { @@ -8,9 +9,10 @@ namespace fichier1.Controllers public class GameController : IGameController { - public GameController() + private Partie game; + public GameController(Partie game) { - + this.game = game; } /// <summary> diff --git a/fichier1/fichier1/MainForm.Designer.cs b/fichier1/fichier1/MainForm.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..123d5e6c4d05649c44d6439de88bf66d4bf9a790 --- /dev/null +++ b/fichier1/fichier1/MainForm.Designer.cs @@ -0,0 +1,58 @@ + +namespace fichier1 +{ + partial class MainForm + { + /// <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() + { + this.pnlContent = new System.Windows.Forms.Panel(); + this.SuspendLayout(); + // + // pnlContent + // + this.pnlContent.Location = new System.Drawing.Point(25, 28); + this.pnlContent.Name = "pnlContent"; + this.pnlContent.Size = new System.Drawing.Size(943, 557); + this.pnlContent.TabIndex = 0; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(995, 611); + this.Controls.Add(this.pnlContent); + this.Name = "MainForm"; + this.Text = "MainForm"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel pnlContent; + } +} \ No newline at end of file diff --git a/fichier1/fichier1/MainForm.cs b/fichier1/fichier1/MainForm.cs new file mode 100644 index 0000000000000000000000000000000000000000..ce2ff784b32cfbb3f8c1e7ad0858e92c52025741 --- /dev/null +++ b/fichier1/fichier1/MainForm.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using fichier1.Model; +using fichier1.Views; +using fichier1.Controllers; + +namespace fichier1 +{ + public partial class MainForm : Form, IObserver<Partie> + { + private Partie game; + private IGameController ctrl; + + public MainForm() + { + InitializeComponent(); + + this.game = new Partie(); + this.ctrl = new GameController(this.game); + } + + public void OnCompleted() + { + pnlContent.Controls.Clear(); + pnlContent.Controls.Add(new ViewResultats(this.ctrl)); + } + + public void OnError(Exception error) + { + throw new NotImplementedException(); + } + + public void OnNext(Partie value) + { + pnlContent.Controls.Clear(); + pnlContent.Controls.Add(new ViewDecoupage(ctrl)); + } + } +} diff --git a/fichier1/fichier1/MainForm.resx b/fichier1/fichier1/MainForm.resx new file mode 100644 index 0000000000000000000000000000000000000000..f298a7be80982ebd538a05758a03bc827419d418 --- /dev/null +++ b/fichier1/fichier1/MainForm.resx @@ -0,0 +1,60 @@ +<root> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file