public void regularUpdate()
 {
     if (h != null)
     {
         h.regularUpdate();
     }
     else if (g != null)
     {
         g.regularUpdate();
         if (g.isBecomeHost())
         {
             h = new HostNetwork(username, g.getMatch(), g.isRoleHider());
             h.StartLobby();
             int timeout = 10;
             while (timeout-- > 0)
             {
                 Thread.Sleep(1000);
             }
             if (g.getMatch() != null)
             {
                 h.startMatch(g.getMatch().getState());
             }
             g = null;
         }
     }
 }
 public void Guest(string hostIP)
 {
     h = null;
     g = new GuestNetwork(username);
     g.ConnectToHost(hostIP);
 }
 public void Host()
 {
     g = null;
     h = new HostNetwork(username);
     h.StartLobby();
 }