コード例 #1
0
ファイル: Game.Outgoing.cs プロジェクト: Dr3nz4r/FreezeTag
 public async ValueTask SendToAllAsync(IMessageWriter writer, LimboStates states = LimboStates.NotLimbo)
 {
     foreach (var connection in GetConnections(x => x.Limbo.HasFlag(states)))
     {
         await connection.SendAsync(writer);
     }
 }
コード例 #2
0
ファイル: GameExtensions.cs プロジェクト: t00thpick1/Impostor
 public static ValueTask SendToAllExceptAsync(this IGame game, IMessageWriter writer, LimboStates states, int?id)
 {
     return(id.HasValue
         ? game.SendToAllExceptAsync(writer, id.Value, states)
         : game.SendToAllAsync(writer, states));
 }
コード例 #3
0
ファイル: GameExtensions.cs プロジェクト: t00thpick1/Impostor
        public static ValueTask SendToAllExceptAsync(this IGame game, IMessageWriter writer, LimboStates states, IClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            return(game.SendToAllExceptAsync(writer, client.Id, states));
        }
コード例 #4
0
ファイル: Game.Outgoing.cs プロジェクト: Dr3nz4r/FreezeTag
 public async ValueTask SendToAllExceptAsync(IMessageWriter writer, int senderId, LimboStates states = LimboStates.NotLimbo)
 {
     foreach (var connection in GetConnections(x =>
                                               x.Limbo.HasFlag(states) &&
                                               x.Client.Id != senderId))
     {
         await connection.SendAsync(writer);
     }
 }