fCraft  0.638
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
fCraft.PlayerEnumerable Class Reference

Contains a set of utilities that simplify working with sets of players. All the utilities are implemented as extension methods, and it is recommended that you invoke them as extension methods. More...

Static Public Member Functions

static IEnumerable< PlayerRanked (this IEnumerable< Player > source, Rank rank)
 Filters a collection of players, leaving only those of the given rank.
 
static IEnumerable< PlayerNotRanked (this IEnumerable< Player > source, Rank rank)
 Filters a collection of players, leaving only those NOT of the given rank.
 
static IEnumerable< PlayerRankedAbove (this IEnumerable< Player > source, Rank minRank)
 Filters a collection of players, leaving only those above the given rank.
 
static IEnumerable< PlayerRankedAtLeast (this IEnumerable< Player > source, Rank minRank)
 Filters a collection of players, leaving only those of or above the given rank.
 
static IEnumerable< PlayerRankedBelow (this IEnumerable< Player > source, Rank maxRank)
 Filters a collection of players, leaving only those below the given rank.
 
static IEnumerable< PlayerRankedAtMost (this IEnumerable< Player > source, Rank maxRank)
 Filters a collection of players, leaving only those of or below the given rank.
 
static IEnumerable< PlayerCan ([NotNull] this IEnumerable< Player > source, Permission permission)
 Filters a collection of players, leaving only those who have the given permission.
 
static IEnumerable< PlayerCan ([NotNull] this IEnumerable< Player > source, Permission permission,[NotNull] Rank affectedRank)
 Filters a collection of players, leaving only those who have the given permission, and with permission limits allowing operation on the given rank.
 
static IEnumerable< PlayerCant ([NotNull] this IEnumerable< Player > source, Permission permission)
 Filters a collection of players, leaving only those who do NOT have the given permission.
 
static IEnumerable< PlayerCant ([NotNull] this IEnumerable< Player > source, Permission permission,[NotNull] Rank affectedRank)
 Filters a collection of players, leaving only those who do NOT have the given permission, or with permission limits NOT allowing operation on the given rank.
 
static IEnumerable< PlayerCanSee ([NotNull] this IEnumerable< Player > source,[NotNull] Player targetPlayer)
 Filters a collection of players, leaving only those who can see the target. Does not include the target itself.
 
static IEnumerable< PlayerCantSee ([NotNull] this IEnumerable< Player > source,[NotNull] Player targetPlayer)
 Filters a collection of players, leaving only those who can NOT see the target. Does not include the target itself.
 
static IEnumerable< PlayerCanBeSeen ([NotNull] this IEnumerable< Player > source,[NotNull] Player observer)
 Filters a collection of players, leaving only those who can be seen by the given player.
 
static IEnumerable< PlayerCantBeSeen ([NotNull] this IEnumerable< Player > source,[NotNull] Player observer)
 Filters a collection of players, leaving only those who can NOT be seen by the given player.
 
static IEnumerable< PlayerIgnoring ([NotNull] this IEnumerable< Player > source,[NotNull] Player player)
 Filters a collection of players, leaving only those who are ignoring the given player.
 
static IEnumerable< PlayerNotIgnoring ([NotNull] this IEnumerable< Player > source,[NotNull] Player player)
 Filters a collection of players, leaving only those who are NOT ignoring the given player.
 
static IEnumerable< PlayerIgnoring ([NotNull] this IEnumerable< Player > source,[NotNull] PlayerInfo playerInfo)
 Filters a collection of players, leaving only those who are ignoring the given player.
 
static IEnumerable< PlayerNotIgnoring ([NotNull] this IEnumerable< Player > source,[NotNull] PlayerInfo playerInfo)
 Filters a collection of players, leaving only those who are NOT ignoring the given player.
 
static IEnumerable< PlayerIgnoredBy ([NotNull] this IEnumerable< Player > source,[NotNull] Player ignorer)
 Filters a collection of players, leaving only those who are ignored by the given player.
 
static IEnumerable< PlayerNotIgnoredBy ([NotNull] this IEnumerable< Player > source,[NotNull] Player ignorer)
 Filters a collection of players, leaving only those who are NOT ignored by the given player.
 
static IEnumerable< PlayerInWorld ([NotNull] this IEnumerable< Player > source,[NotNull] World world)
 Filters a collection of players, leaving only those who are currently located on the given world.
 
static IEnumerable< PlayerNotInWorld ([NotNull] this IEnumerable< Player > source,[NotNull] World world)
 Filters a collection of players, leaving only those who are currently NOT located on the given world.
 
static IEnumerable< PlayerUnion ([NotNull] this IEnumerable< Player > source,[NotNull] Player includedPlayer)
 Adds players to the given set. If the given sequence of players already contains player, no duplicate is added. Precisely speaking, produces the set union of a given collection of players and a given player.
 
static IEnumerable< PlayerExcept ([NotNull] this IEnumerable< Player > source,[CanBeNull] Player excludedPlayer)
 Removes player from the given set. Precisely speaking, produces the set difference between the given collection of players and a given player.
 
static IEnumerable< PlayerFromIP ([NotNull] this IEnumerable< Player > source,[NotNull] IPAddress ip)
 Filters a collection of players, leaving only those connected from a given IP.
 
static IEnumerable< PlayerNotFromIP ([NotNull] this IEnumerable< Player > source,[NotNull] IPAddress ip)
 Filters a collection of players, leaving only those NOT connected from a given IP.
 
static int Message ([NotNull] this IEnumerable< Player > source,[NotNull] string message,[NotNull] params object[] formatArgs)
 Formats and broadcasts a message. Same semantics as Player.Message().
 
static int Message ([NotNull] this IEnumerable< Player > source,[CanBeNull] Player except,[NotNull] string message,[NotNull] params object[] formatArgs)
 Formats and broadcasts a message.
 
static int MessagePrefixed ([NotNull] this IEnumerable< Player > source,[NotNull] string prefix,[NotNull] string message,[NotNull] params object[] formatArgs)
 Formats and broadcasts a message, prefixing wrapped lines.
 
static int MessageWoMAlert ([NotNull] this IEnumerable< Player > source,[NotNull] string message,[NotNull] params object[] formatArgs)
 Formats and broadcasts a message, showing on top-left for those who use WoM.
 
static int Send ([NotNull] this IEnumerable< Player > source, Packet packet)
 Broadcasts a packet with normal priority.
 
static int Send ([NotNull] this IEnumerable< Player > source,[CanBeNull] Player except, Packet packet)
 Broadcasts a packet with normal priority.
 
static int SendLowPriority ([NotNull] this IEnumerable< Player > source, Packet packet)
 Broadcasts a packet with low priority.
 
static int SendLowPriority ([NotNull] this IEnumerable< Player > source,[CanBeNull] Player except, Packet packet)
 Broadcasts a packet with low priority.
 

Detailed Description

Contains a set of utilities that simplify working with sets of players. All the utilities are implemented as extension methods, and it is recommended that you invoke them as extension methods.

Member Function Documentation

static IEnumerable<Player> fCraft.PlayerEnumerable.Can ( [NotNull] this IEnumerable< Player source,
Permission  permission 
)
static

Filters a collection of players, leaving only those who have the given permission.

Parameters
sourceOriginal collection of players. Will not get modified.
permissionPermission that players are required to have.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.Can ( [NotNull] this IEnumerable< Player source,
Permission  permission,
[NotNull] Rank  affectedRank 
)
static

Filters a collection of players, leaving only those who have the given permission, and with permission limits allowing operation on the given rank.

Parameters
sourceOriginal collection of players. Will not get modified.
permissionPermission that players are required to have.
affectedRankPermission limit will be checked against this rank.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.CanBeSeen ( [NotNull] this IEnumerable< Player source,
[NotNull] Player  observer 
)
static

Filters a collection of players, leaving only those who can be seen by the given player.

Parameters
sourceOriginal collection of players. Will not get modified.
observerPlayer whose vision is being tested.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.CanSee ( [NotNull] this IEnumerable< Player source,
[NotNull] Player  targetPlayer 
)
static

Filters a collection of players, leaving only those who can see the target. Does not include the target itself.

Parameters
sourceOriginal collection of players. Will not get modified.
targetPlayerPlayer whose visibility is being tested.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.Cant ( [NotNull] this IEnumerable< Player source,
Permission  permission 
)
static

Filters a collection of players, leaving only those who do NOT have the given permission.

Parameters
sourceOriginal collection of players. Will not get modified.
permissionPermission that players are required to NOT have.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.Cant ( [NotNull] this IEnumerable< Player source,
Permission  permission,
[NotNull] Rank  affectedRank 
)
static

Filters a collection of players, leaving only those who do NOT have the given permission, or with permission limits NOT allowing operation on the given rank.

Parameters
sourceOriginal collection of players. Will not get modified.
permissionPermission that players are required to NOT have.
affectedRankPermission limit will be checked against this rank.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.CantBeSeen ( [NotNull] this IEnumerable< Player source,
[NotNull] Player  observer 
)
static

Filters a collection of players, leaving only those who can NOT be seen by the given player.

Parameters
sourceOriginal collection of players. Will not get modified.
observerPlayer whose vision is being tested.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.CantSee ( [NotNull] this IEnumerable< Player source,
[NotNull] Player  targetPlayer 
)
static

Filters a collection of players, leaving only those who can NOT see the target. Does not include the target itself.

Parameters
sourceOriginal collection of players. Will not get modified.
targetPlayerPlayer whose visibility is being tested.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.Except ( [NotNull] this IEnumerable< Player source,
[CanBeNull] Player  excludedPlayer 
)
static

Removes player from the given set. Precisely speaking, produces the set difference between the given collection of players and a given player.

Parameters
sourceOriginal set of players. Will not get modified.
excludedPlayerPlayer to remove from the set.
Returns
A set that contains all players in the input sequence, minus the given player.
static IEnumerable<Player> fCraft.PlayerEnumerable.FromIP ( [NotNull] this IEnumerable< Player source,
[NotNull] IPAddress  ip 
)
static

Filters a collection of players, leaving only those connected from a given IP.

Parameters
sourceOriginal collection of players. Will not get modified.
ipIP that we are including.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.IgnoredBy ( [NotNull] this IEnumerable< Player source,
[NotNull] Player  ignorer 
)
static

Filters a collection of players, leaving only those who are ignored by the given player.

Parameters
sourceOriginal collection of players. Will not get modified.
ignorerPlayer whose disposition is being checked.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.Ignoring ( [NotNull] this IEnumerable< Player source,
[NotNull] Player  player 
)
static

Filters a collection of players, leaving only those who are ignoring the given player.

Parameters
sourceOriginal collection of players. Will not get modified.
playerPlayer whose ignore standing is being checked.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.Ignoring ( [NotNull] this IEnumerable< Player source,
[NotNull] PlayerInfo  playerInfo 
)
static

Filters a collection of players, leaving only those who are ignoring the given player.

Parameters
sourceOriginal collection of players. Will not get modified.
playerInfoPlayer whose ignore standing is being checked.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.InWorld ( [NotNull] this IEnumerable< Player source,
[NotNull] World  world 
)
static

Filters a collection of players, leaving only those who are currently located on the given world.

Parameters
sourceOriginal collection of players. Will not get modified.
worldWorld that players are desired to be on.
Returns
Filtered collection of players.
static int fCraft.PlayerEnumerable.Message ( [NotNull] this IEnumerable< Player source,
[NotNull] string  message,
[NotNull] params object[]  formatArgs 
)
static

Formats and broadcasts a message. Same semantics as Player.Message().

Parameters
sourceList of players who will receive the message.
messageA composite format string for the message. Same semantics as String.Format().
formatArgsAn object array that contains zero or more objects to format.
Returns
Number of players who received the message.
Exceptions
ArgumentNullExceptionsource, message, or formatArgs is null.
FormatExceptionMessage format is invalid.
static int fCraft.PlayerEnumerable.Message ( [NotNull] this IEnumerable< Player source,
[CanBeNull] Player  except,
[NotNull] string  message,
[NotNull] params object[]  formatArgs 
)
static

Formats and broadcasts a message.

Parameters
sourceList of players who will receive the message.
exceptPlayer to exclude from the recepient list. May be null (no one will be excluded).
messageA composite format string for the message. Same semantics as String.Format().
formatArgsAn object array that contains zero or more objects to format.
Returns
Number of players who received the message.
Exceptions
ArgumentNullExceptionsource, message, or formatArgs is null.
FormatExceptionMessage format is invalid.
static int fCraft.PlayerEnumerable.MessagePrefixed ( [NotNull] this IEnumerable< Player source,
[NotNull] string  prefix,
[NotNull] string  message,
[NotNull] params object[]  formatArgs 
)
static

Formats and broadcasts a message, prefixing wrapped lines.

Parameters
sourceList of players who will receive the message.
prefixPrefix to prepend to prepend to each line after the 1st, if any line-wrapping occurs. Does NOT get prepended to first line.
messageA composite format string for the message. Same semantics as String.Format().
formatArgsAn object array that contains zero or more objects to format.
Returns
Number of players who received the message.
Exceptions
ArgumentNullExceptionsource, prefix, message, or formatArgs is null.
FormatExceptionMessage format is invalid.
static int fCraft.PlayerEnumerable.MessageWoMAlert ( [NotNull] this IEnumerable< Player source,
[NotNull] string  message,
[NotNull] params object[]  formatArgs 
)
static

Formats and broadcasts a message, showing on top-left for those who use WoM.

Parameters
sourceList of players who will receive the message.
messageA composite format string for the message. Same semantics as String.Format().
formatArgsAn object array that contains zero or more objects to format.
Returns
Number of players who received the message.
Exceptions
ArgumentNullExceptionsource, message, or formatArgs is null.
FormatExceptionMessage format is invalid.
static IEnumerable<Player> fCraft.PlayerEnumerable.NotFromIP ( [NotNull] this IEnumerable< Player source,
[NotNull] IPAddress  ip 
)
static

Filters a collection of players, leaving only those NOT connected from a given IP.

Parameters
sourceOriginal collection of players. Will not get modified.
ipIP that we are excluding.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.NotIgnoredBy ( [NotNull] this IEnumerable< Player source,
[NotNull] Player  ignorer 
)
static

Filters a collection of players, leaving only those who are NOT ignored by the given player.

Parameters
sourceOriginal collection of players. Will not get modified.
ignorerPlayer whose disposition is being checked.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.NotIgnoring ( [NotNull] this IEnumerable< Player source,
[NotNull] Player  player 
)
static

Filters a collection of players, leaving only those who are NOT ignoring the given player.

Parameters
sourceOriginal collection of players. Will not get modified.
playerPlayer whose ignore standing is being checked.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.NotIgnoring ( [NotNull] this IEnumerable< Player source,
[NotNull] PlayerInfo  playerInfo 
)
static

Filters a collection of players, leaving only those who are NOT ignoring the given player.

Parameters
sourceOriginal collection of players. Will not get modified.
playerInfoPlayer whose ignore standing is being checked.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.NotInWorld ( [NotNull] this IEnumerable< Player source,
[NotNull] World  world 
)
static

Filters a collection of players, leaving only those who are currently NOT located on the given world.

Parameters
sourceOriginal collection of players. Will not get modified.
worldWorld that players are desired to NOT be on.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.NotRanked ( this IEnumerable< Player source,
Rank  rank 
)
static

Filters a collection of players, leaving only those NOT of the given rank.

Parameters
sourceOriginal collection of players. Will not get modified.
rankUndesired rank.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.Ranked ( this IEnumerable< Player source,
Rank  rank 
)
static

Filters a collection of players, leaving only those of the given rank.

Parameters
sourceOriginal collection of players. Will not get modified.
rankDesired rank.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.RankedAbove ( this IEnumerable< Player source,
Rank  minRank 
)
static

Filters a collection of players, leaving only those above the given rank.

Parameters
sourceOriginal collection of players. Will not get modified.
minRankAll ranks above this one will be kept. This and lower ranks will be filtered out.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.RankedAtLeast ( this IEnumerable< Player source,
Rank  minRank 
)
static

Filters a collection of players, leaving only those of or above the given rank.

Parameters
sourceOriginal collection of players. Will not get modified.
minRankMinimum desired rank.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.RankedAtMost ( this IEnumerable< Player source,
Rank  maxRank 
)
static

Filters a collection of players, leaving only those of or below the given rank.

Parameters
sourceOriginal collection of players. Will not get modified.
maxRankMaximum desired rank.
Returns
Filtered collection of players.
static IEnumerable<Player> fCraft.PlayerEnumerable.RankedBelow ( this IEnumerable< Player source,
Rank  maxRank 
)
static

Filters a collection of players, leaving only those below the given rank.

Parameters
sourceOriginal collection of players. Will not get modified.
maxRankAll ranks below this one will be kept. This and higher ranks will be filtered out.
Returns
Filtered collection of players.
static int fCraft.PlayerEnumerable.Send ( [NotNull] this IEnumerable< Player source,
Packet  packet 
)
static

Broadcasts a packet with normal priority.

Parameters
sourceList of players who will receive the packet.
packetPacket to send.
Returns
Number of players who received the packet.
static int fCraft.PlayerEnumerable.Send ( [NotNull] this IEnumerable< Player source,
[CanBeNull] Player  except,
Packet  packet 
)
static

Broadcasts a packet with normal priority.

Parameters
sourceList of players who will receive the packet.
exceptPlayer to exclude from the recepient list.
packetPacket to send.
Returns
Number of players who received the packet.
static int fCraft.PlayerEnumerable.SendLowPriority ( [NotNull] this IEnumerable< Player source,
Packet  packet 
)
static

Broadcasts a packet with low priority.

Parameters
sourceList of players who will receive the packet.
packetPacket to send.
Returns
Number of players who received the packet.
static int fCraft.PlayerEnumerable.SendLowPriority ( [NotNull] this IEnumerable< Player source,
[CanBeNull] Player  except,
Packet  packet 
)
static

Broadcasts a packet with low priority.

Parameters
sourceList of players who will receive the packet.
exceptPlayer to exclude from the recepient list.
packetPacket to send.
Returns
Number of players who received the packet.
static IEnumerable<Player> fCraft.PlayerEnumerable.Union ( [NotNull] this IEnumerable< Player source,
[NotNull] Player  includedPlayer 
)
static

Adds players to the given set. If the given sequence of players already contains player, no duplicate is added. Precisely speaking, produces the set union of a given collection of players and a given player.

Parameters
sourceOriginal set of players. Will not get modified.
includedPlayerPlayer to add to the set.
Returns
A set that contains all players in the input sequence, plus the given player.

The documentation for this class was generated from the following file: