コード例 #1
0
        /// <summary>
        ///   Sends the event to signal devices that the game has ended.
        /// </summary>
        ///
        /// <param name="devices">The devices to which the event should be communicated.</param>
        ///
        public Task SendEndEventAsync(IEnumerable <GameDevice> devices)
        {
            return(Task.WhenAll(devices.Select(device =>
            {
                var task = ParticleDeviceCommunicator.InvokeWebHook(device, "endGame");
                task.ConfigureAwait(false);

                return task;
            })));
        }
コード例 #2
0
 /// <summary>
 ///   Sends the event to signal a devices that it was chosen to as the game winner.
 /// </summary>
 ///
 /// <param name="device">The device to which the event should be communicated.</param>
 ///
 public Task SendWinEventAsync(GameDevice device)
 {
     return(ParticleDeviceCommunicator.InvokeWebHook(device, "winner"));
 }
コード例 #3
0
 /// <summary>
 ///   Sends the event to signal a devices that it was eliminated from the game.
 /// </summary>
 ///
 /// <param name="device">The device to which the event should be communicated.</param>
 ///
 public Task SendEliminatedEventAsync(GameDevice device)
 {
     return(ParticleDeviceCommunicator.InvokeWebHook(device, "eliminated"));
 }
コード例 #4
0
 /// <summary>
 ///   Sends the event to signal a devices that it was chosen to as the active ping.
 /// </summary>
 ///
 /// <param name="device">The device to which the event should be communicated.</param>
 /// <param name="timeoutSeconds">The duration of the timeout for the ping, in seconds.</param>
 ///
 public Task SendPingEventAsync(GameDevice device,
                                int timeoutSeconds)
 {
     return(ParticleDeviceCommunicator.InvokeWebHook(device, "ping", TimeSpan.FromSeconds(timeoutSeconds).TotalMilliseconds.ToString()));
 }