private void InitPartita() { _socket.Input(new Utility.Messages.GiocatoreProntoMessageEventArgs(_nomeUtente)); _socket.Output -= MasterHandShake; _currentPartita = new PartitaGiocatore(); _currentPartita.Dock = DockStyle.Fill; _currentPartita.BindComponent(_socket); GestoreSchedeGiocatore gestoreSchede = new GestoreSchedeGiocatore(); gestoreSchede.Carica(_path + CurrentDescrittore.IdPartita); _currentPartita.BindComponent(gestoreSchede); ChatComune chatComune = new ChatComune(); _currentPartita.BindComponent(chatComune); ChatCoordinamentoGiocatore chatCoordinamentoGiocatore = new ChatCoordinamentoGiocatore(); _currentPartita.BindComponent(chatCoordinamentoGiocatore); this.form = new Form(); this.form.FormClosing += gestoreSchede.Salva; this.form.FormClosed += LeavePartita; this.form.Controls.Add(_currentPartita); this.form.Size = new System.Drawing.Size(800, 600); System.Drawing.Rectangle resolution = Screen.PrimaryScreen.Bounds; this.form.Location = new System.Drawing.Point(resolution.Width - 800, resolution.Height - 650); this.form.Text = CurrentDescrittore.Nome; this.form.Show(); }
private DocumentoGiocatore() : base() { _currentPartita = null; _mainForm = new MainFormGiocatore(); try { _mainForm.Descrittori = _persister.LoadDescrittorePartita(_path + "Descrittori.xml"); } catch { _persister.SaveDescrittorePartita(_path + "Descrittori.xml", new List <DescrittorePartita>()); } System.Drawing.Rectangle resolution = Screen.PrimaryScreen.Bounds; _mainForm.Location = new System.Drawing.Point(resolution.Width - 800, 0); }