public static NewGameRequestManager GetInstance(int idPlayer) { if (NewGameRequestManager.instance == null) { NewGameRequestManager.instance = new NewGameRequestManager(idPlayer); } return(NewGameRequestManager.instance); }
public FormMainScreen(string idPlayer) { InitializeComponent(); this.idPlayer = idPlayer; NewGameRequestManager.GetInstance(Convert.ToInt32(this.idPlayer)); aTimer = new System.Timers.Timer(); aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent); aTimer.Interval = 1000; aTimer.Enabled = true; this.Text = "Tela Principal - Id: " + idPlayer; FormSkinManager.LoadMe(); }
private void btnStartGameNow_Click(object sender, EventArgs e) { NewGameRequestManager.GetInstance(Convert.ToInt32(idPlayer)).enablePlaying(); }
private void FormMainScreen_FormClosing(object sender, FormClosingEventArgs e) { NewGameRequestManager.Cancel(); }
public static void Cancel() { NewGameRequestManager.instance.timer.Dispose(); NewGameRequestManager.instance = null; }