C# Класс TShockAPI.DB.RegionManager

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
Regions List

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
ListIDs ( string MergedIDs ) : List
RegionManager ( IDbConnection db ) : System

Описание методов

AddNewUser() публичный Метод

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
Результат bool

AddRegion() публичный Метод

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.
Результат bool

AllowGroup() публичный Метод

Allows a group to use a region
public AllowGroup ( string regionName, string groupName ) : bool
regionName string Region name
groupName string Group's name
Результат bool

CanBuild() публичный Метод

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
Результат bool

ChangeOwner() публичный Метод

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
Результат bool

DeleteRegion() публичный Метод

Delets the region from this world with a given ID.
public DeleteRegion ( int id ) : bool
id int The ID of the region to delete.
Результат bool

DeleteRegion() публичный Метод

Deletes the region from this world with a given name.
public DeleteRegion ( string name ) : bool
name string The name of the region to delete.
Результат bool

GetRegionByID() публичный Метод

Returns a region with the given ID
public GetRegionByID ( int id ) : Region
id int Region ID
Результат Region

GetRegionByName() публичный Метод

Returns a region with the given name
public GetRegionByName ( String name ) : Region
name String Region name
Результат Region

GetTopRegion() публичный Метод

Returns the Region with the highest Z index of the given list
public GetTopRegion ( IEnumerable regions ) : Region
regions IEnumerable List of Regions to compare
Результат Region

InArea() публичный Метод

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
Результат bool

InAreaRegion() публичный Метод

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
Результат IEnumerable

InAreaRegionID() публичный Метод

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
Результат IEnumerable

InAreaRegionName() публичный Метод

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
Результат IEnumerable

ListAllRegions() публичный Метод

Gets all the regions names from world
public ListAllRegions ( string worldid ) : List
worldid string World name to get regions from
Результат List

PositionRegion() публичный Метод

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.
Результат bool

Reload() публичный Метод

Reloads all regions.
public Reload ( ) : void
Результат void

RemoveGroup() публичный Метод

Removes a group's access to a region
public RemoveGroup ( string regionName, string group ) : bool
regionName string Region name
group string Group name
Результат bool

RemoveUser() публичный Метод

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
Результат bool

ResizeRegion() публичный Метод

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.
Результат bool

SetRegionState() публичный Метод

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.
Результат bool

SetRegionState() публичный Метод

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.
Результат bool

SetZ() публичный Метод

Sets the Z index of a given region
public SetZ ( string name, int z ) : bool
name string Region name
z int New Z index
Результат bool

Описание свойств

Regions публичное свойство

The list of regions.
public List Regions
Результат List