示例#1
0
文件: SingleHost.cs 项目: sunoru/PBO
 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();
 }
示例#2
0
 public SingleClient(int hostId, Game.GameSettings settings)
 {
   HostId = hostId;
   user = new Player(hostId);
   user.SendCommand += (command) => OnMessageSent(command.ToMessage(), HostId);
 }