// deserialise public PartieActuelle(SerializationInfo info, StreamingContext context) { aireJeu = (Rectangle)info.GetValue("AireJeu", typeof(Rectangle)); jeu = (JeuRegles)info.GetValue("Jeu", typeof(JeuRegles)); menuContextuel = (MenuContextuel)info.GetValue("MenuContextuel", typeof(MenuContextuel)); options = (Options)info.GetValue("Options", typeof(Options)); }
public PartieActuelle(PictureBox pictureBox) { options = Options.Instance; jeu = new JeuRegles(options.GetOption("EmplacementPiece")); aireJeu = new Rectangle(0, 0, 612, 800); menuContextuel = new MenuContextuel(pictureBox); menuContextuel.GenereMenu(jeu); }
public void GenereMenu(JeuRegles jeu = null) { if (jeu != null) { this.jeu = jeu; } contextMenu.MenuItems.Clear(); foreach (KeyValuePair <string, int> piece in this.jeu.ListePieces) { contextMenu.MenuItems.Add(piece.Value + " - " + piece.Key, Menu_OnClick); } }