C# Class TShockAPI.DB.RegionManager

Afficher le fichier Open project: NyxStudios/TShock

Méthodes publiques

Свойство Type Description
Regions List

Méthodes publiques

Méthode Description
AddNewUser ( string regionName, string userName ) : bool

Adds a user to a region's allowed user list

AddRegion ( int tx, int ty, int width, int height, string regionname, string owner, string worldid, int z ) : bool

Adds a region to the database.

AllowGroup ( string regionName, string groupName ) : bool

Allows a group to use a region

CanBuild ( int x, int y, TSPlayer ply ) : bool

Checks if a given player can build in a region at the given (x, y) coordinate

ChangeOwner ( string regionName, string newOwner ) : bool

Changes the owner of the region with the given name

DeleteRegion ( int id ) : bool

Delets the region from this world with a given ID.

DeleteRegion ( string name ) : bool

Deletes the region from this world with a given name.

GetRegionByID ( int id ) : Region

Returns a region with the given ID

GetRegionByName ( String name ) : Region

Returns a region with the given name

GetTopRegion ( IEnumerable regions ) : Region

Returns the Region with the highest Z index of the given list

InArea ( int x, int y ) : bool

Checks if any regions exist at the given (x, y) coordinate

InAreaRegion ( int x, int y ) : IEnumerable

Checks if any regions exist at the given (x, y) coordinate and returns an IEnumerable containing their Region objects

InAreaRegionID ( int x, int y ) : IEnumerable

Checks if any regions exist at the given (x, y) coordinate and returns an IEnumerable containing their IDs

InAreaRegionName ( int x, int y ) : IEnumerable

Checks if any regions exist at the given (x, y) coordinate and returns an IEnumerable containing their names

ListAllRegions ( string worldid ) : List

Gets all the regions names from world

PositionRegion ( string regionName, int x, int y, int width, int height ) : bool

Sets the position of a region.

Reload ( ) : void

Reloads all regions.

RemoveGroup ( string regionName, string group ) : bool

Removes a group's access to a region

RemoveUser ( string regionName, string userName ) : bool

Removes an allowed user from a region

ResizeRegion ( string regionName, int addAmount, int direction ) : bool

Changes the size of a given region

SetRegionState ( int id, bool state ) : bool

Sets the protected state of the region with a given ID.

SetRegionState ( string name, bool state ) : bool

Sets the protected state of the region with a given name.

SetZ ( string name, int z ) : bool

Sets the Z index of a given region

Private Methods

Méthode Description
ListIDs ( string MergedIDs ) : List
RegionManager ( IDbConnection db ) : System

Method Details

AddNewUser() public méthode

Adds a user to a region's allowed user list
public AddNewUser ( string regionName, string userName ) : bool
regionName string Name of the region to modify
userName string Username to add
Résultat bool

AddRegion() public méthode

Adds a region to the database.
public AddRegion ( int tx, int ty, int width, int height, string regionname, string owner, string worldid, int z ) : bool
tx int TileX of the top left corner.
ty int TileY of the top left corner.
width int Width of the region in tiles.
height int Height of the region in tiles.
regionname string The name of the region.
owner string The User Account Name of the person who created this region.
worldid string The world id that this region is in.
z int The Z index of the region.
Résultat bool

AllowGroup() public méthode

Allows a group to use a region
public AllowGroup ( string regionName, string groupName ) : bool
regionName string Region name
groupName string Group's name
Résultat bool

CanBuild() public méthode

Checks if a given player can build in a region at the given (x, y) coordinate
public CanBuild ( int x, int y, TSPlayer ply ) : bool
x int X coordinate
y int Y coordinate
ply TSPlayer Player to check permissions with
Résultat bool

ChangeOwner() public méthode

Changes the owner of the region with the given name
public ChangeOwner ( string regionName, string newOwner ) : bool
regionName string Region name
newOwner string New owner's username
Résultat bool

DeleteRegion() public méthode

Delets the region from this world with a given ID.
public DeleteRegion ( int id ) : bool
id int The ID of the region to delete.
Résultat bool

DeleteRegion() public méthode

Deletes the region from this world with a given name.
public DeleteRegion ( string name ) : bool
name string The name of the region to delete.
Résultat bool

GetRegionByID() public méthode

Returns a region with the given ID
public GetRegionByID ( int id ) : Region
id int Region ID
Résultat Region

GetRegionByName() public méthode

Returns a region with the given name
public GetRegionByName ( String name ) : Region
name String Region name
Résultat Region

GetTopRegion() public méthode

Returns the Region with the highest Z index of the given list
public GetTopRegion ( IEnumerable regions ) : Region
regions IEnumerable List of Regions to compare
Résultat Region

InArea() public méthode

Checks if any regions exist at the given (x, y) coordinate
public InArea ( int x, int y ) : bool
x int X coordinate
y int Y coordinate
Résultat bool

InAreaRegion() public méthode

Checks if any regions exist at the given (x, y) coordinate and returns an IEnumerable containing their Region objects
public InAreaRegion ( int x, int y ) : IEnumerable
x int X coordinate
y int Y coordinate
Résultat IEnumerable

InAreaRegionID() public méthode

Checks if any regions exist at the given (x, y) coordinate and returns an IEnumerable containing their IDs
public InAreaRegionID ( int x, int y ) : IEnumerable
x int X coordinate
y int Y coordinate
Résultat IEnumerable

InAreaRegionName() public méthode

Checks if any regions exist at the given (x, y) coordinate and returns an IEnumerable containing their names
public InAreaRegionName ( int x, int y ) : IEnumerable
x int X coordinate
y int Y coordinate
Résultat IEnumerable

ListAllRegions() public méthode

Gets all the regions names from world
public ListAllRegions ( string worldid ) : List
worldid string World name to get regions from
Résultat List

PositionRegion() public méthode

Sets the position of a region.
public PositionRegion ( string regionName, int x, int y, int width, int height ) : bool
regionName string The region name.
x int The X position.
y int The Y position.
width int The width.
height int The height.
Résultat bool

Reload() public méthode

Reloads all regions.
public Reload ( ) : void
Résultat void

RemoveGroup() public méthode

Removes a group's access to a region
public RemoveGroup ( string regionName, string group ) : bool
regionName string Region name
group string Group name
Résultat bool

RemoveUser() public méthode

Removes an allowed user from a region
public RemoveUser ( string regionName, string userName ) : bool
regionName string Name of the region to modify
userName string Username to remove
Résultat bool

ResizeRegion() public méthode

Changes the size of a given region
public ResizeRegion ( string regionName, int addAmount, int direction ) : bool
regionName string Name of the region to resize
addAmount int Amount to resize
direction int Direction to resize in: /// 0 = resize height and Y. /// 1 = resize width. /// 2 = resize height. /// 3 = resize width and X.
Résultat bool

SetRegionState() public méthode

Sets the protected state of the region with a given ID.
public SetRegionState ( int id, bool state ) : bool
id int The ID of the region to change.
state bool New protected state of the region.
Résultat bool

SetRegionState() public méthode

Sets the protected state of the region with a given name.
public SetRegionState ( string name, bool state ) : bool
name string The name of the region to change.
state bool New protected state of the region.
Résultat bool

SetZ() public méthode

Sets the Z index of a given region
public SetZ ( string name, int z ) : bool
name string Region name
z int New Z index
Résultat bool

Property Details

Regions public_oe property

The list of regions.
public List Regions
Résultat List