Ejemplo n.º 1
0
 public SingleHost(int adminId, Game.GameSettings settings)
 {
     host = new Host(settings);
       host.SendInformation += (info, ids) => OnMessageSent(info.ToMessage(), ids);
       host.PropertyChanged += (sender, e) =>
     {
       if (e.PropertyName == Host.CAN_START_GAME) ((Host)sender).StartGame();
     };
       user = new Player(adminId);
       user.SendCommand += (command) => OnMessageSent(command.ToMessage(), adminId);
       user.Quited += () => host.CloseRoom();
 }
Ejemplo n.º 2
0
 public SingleClient(int hostId, Game.GameSettings settings)
 {
   HostId = hostId;
   user = new Player(hostId);
   user.SendCommand += (command) => OnMessageSent(command.ToMessage(), HostId);
 }