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

A collection of zones within a map. More...

+ Inheritance diagram for fCraft.ZoneCollection:
+ Collaboration diagram for fCraft.ZoneCollection:

Public Member Functions

 ZoneCollection ()
 
 ZoneCollection ([NotNull] ZoneCollection other)
 
void Add ([NotNull] Zone zoneToAdd)
 Adds a new zone to the collection. The name of the zone cannot match existing names.
 
void Clear ()
 Removes all zones from the collection.
 
bool Contains ([NotNull] Zone zone)
 Checks whether a given zone is in the collection.
 
bool Contains ([NotNull] string zoneName)
 Checks whether any zone with a given name is in the collection.
 
bool Remove ([NotNull] Zone zoneToRemove)
 Removes a zone from the collection.
 
bool Remove ([NotNull] string zoneName)
 Removes a zone from the collection, by name.
 
PermissionOverride Check (Vector3I coords,[NotNull] Player player)
 Checks how zones affect the given player's ability to affect a block at given coordinates.
 
bool CheckDetailed (Vector3I coords,[NotNull] Player player,[NotNull] out Zone[] allowedZones,[NotNull] out Zone[] deniedZones)
 Checks how zones affect the given player's ability to affect a block at given coordinates, in detail.
 
Zone FindDenied (Vector3I coords,[NotNull] Player player)
 Finds which zone denied player's ability to affect a block at given coordinates. Used in conjunction with CheckZones().
 
Zone FindExact ([NotNull] string name)
 Finds a zone by name, without using autocompletion. Zone names are case-insensitive.
 
Zone Find ([NotNull] string name)
 Finds a zone by name, with autocompletion. Zone names are case-insensitive. Note that this method is a lot slower than FindExact.
 
void Rename ([NotNull] Zone zone,[NotNull] string newName)
 Changes the name of a given zone.
 
IEnumerator< ZoneGetEnumerator ()
 
void CopyTo (Zone[] array, int arrayIndex)
 
object Clone ()
 

Properties

Zone[] Cache [get, set]
 
int Count [get]
 Returns the total number of zones in this collection.
 
bool IsReadOnly [get]
 
bool IsSynchronized [get]
 
object SyncRoot [get]
 

Events

EventHandler Changed
 
- Events inherited from fCraft.INotifiesOnChange
EventHandler Changed
 

Detailed Description

A collection of zones within a map.

Constructor & Destructor Documentation

fCraft.ZoneCollection.ZoneCollection ( )
fCraft.ZoneCollection.ZoneCollection ( [NotNull] ZoneCollection  other)

Member Function Documentation

void fCraft.ZoneCollection.Add ( [NotNull] Zone  zoneToAdd)

Adds a new zone to the collection. The name of the zone cannot match existing names.

Exceptions
ArgumentNullExceptionzoneToAdd is null.
ArgumentExceptionThis exact zone, or another zone with the same name is already in this ZoneCollection.
PermissionOverride fCraft.ZoneCollection.Check ( Vector3I  coords,
[NotNull] Player  player 
)

Checks how zones affect the given player's ability to affect a block at given coordinates.

Parameters
coordsBlock coordinates.
playerPlayer to check.
Returns
None if no zones affect the coordinate. Allow if ALL affecting zones allow the player. Deny if ANY affecting zone denies the player.
Exceptions
ArgumentNullExceptionplayer is null.
bool fCraft.ZoneCollection.CheckDetailed ( Vector3I  coords,
[NotNull] Player  player,
[NotNull] out Zone[]  allowedZones,
[NotNull] out Zone[]  deniedZones 
)

Checks how zones affect the given player's ability to affect a block at given coordinates, in detail.

Parameters
coordsBlock coordinates.
playerPlayer to check.
allowedZonesArray of zones that allow the player to build.
deniedZonesArray of zones that deny the player from building.
Returns
True if any zones were found. False if none affect the given coordinate.
Exceptions
ArgumentNullExceptionplayer is null.
void fCraft.ZoneCollection.Clear ( )

Removes all zones from the collection.

object fCraft.ZoneCollection.Clone ( )
bool fCraft.ZoneCollection.Contains ( [NotNull] Zone  zone)

Checks whether a given zone is in the collection.

Exceptions
ArgumentNullExceptionzone is null.
bool fCraft.ZoneCollection.Contains ( [NotNull] string  zoneName)

Checks whether any zone with a given name is in the collection.

Exceptions
ArgumentNullExceptionzoneName is null.
void fCraft.ZoneCollection.CopyTo ( Zone[]  array,
int  arrayIndex 
)
Zone fCraft.ZoneCollection.Find ( [NotNull] string  name)

Finds a zone by name, with autocompletion. Zone names are case-insensitive. Note that this method is a lot slower than FindExact.

Parameters
nameFull zone name.
Returns
Zone object if it was found. null if no Zone with the given name could be found.
Exceptions
ArgumentNullExceptionname is null.
Zone fCraft.ZoneCollection.FindDenied ( Vector3I  coords,
[NotNull] Player  player 
)

Finds which zone denied player's ability to affect a block at given coordinates. Used in conjunction with CheckZones().

Parameters
coordsBlock coordinates.
playerPlayer to check.
Returns
First zone to deny the player. null if none of the zones deny the player.
Exceptions
ArgumentNullExceptionplayer is null.
Zone fCraft.ZoneCollection.FindExact ( [NotNull] string  name)

Finds a zone by name, without using autocompletion. Zone names are case-insensitive.

Parameters
nameFull zone name.
Returns
Zone object if it was found. null if no Zone with the given name could be found.
Exceptions
ArgumentNullExceptionname is null.
IEnumerator<Zone> fCraft.ZoneCollection.GetEnumerator ( )
bool fCraft.ZoneCollection.Remove ( [NotNull] Zone  zoneToRemove)

Removes a zone from the collection.

Returns
True if the given zone was found and removed. False if this collection did not contain the given zone.
Exceptions
ArgumentNullExceptionzoneToRemove is null.
bool fCraft.ZoneCollection.Remove ( [NotNull] string  zoneName)

Removes a zone from the collection, by name.

Returns
True if the given zone was found and removed. False if this collection did not contain the given zone.
Exceptions
ArgumentNullExceptionzoneName is null.
void fCraft.ZoneCollection.Rename ( [NotNull] Zone  zone,
[NotNull] string  newName 
)

Changes the name of a given zone.

Parameters
zoneZone to rename.
newNameNew name to give to the zone.
Exceptions
ArgumentNullExceptionzone or newName is null.
System.ArgumentExceptionA zone with a given newName already exists, or trying to rename a zone that does not exist.

Property Documentation

Zone [] fCraft.ZoneCollection.Cache
getset
int fCraft.ZoneCollection.Count
get

Returns the total number of zones in this collection.

bool fCraft.ZoneCollection.IsReadOnly
get
bool fCraft.ZoneCollection.IsSynchronized
get
object fCraft.ZoneCollection.SyncRoot
get

Event Documentation

EventHandler fCraft.ZoneCollection.Changed

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