Table of Contents

Class MapSector

Namespace
Moongate.UO.Data.Maps
Assembly
Moongate.UO.Data.dll

Represents a single sector of the map containing entities Optimized for fast add/remove/lookup operations

public class MapSector
Inheritance
MapSector
Inherited Members

Constructors

MapSector(int, int, int)

public MapSector(int mapIndex, int sectorX, int sectorY)

Parameters

mapIndex int
sectorX int
sectorY int

Properties

Bounds

World bounds of this sector

public Rectangle2D Bounds { get; }

Property Value

Rectangle2D

EntityCount

Total number of entities in this sector

public int EntityCount { get; }

Property Value

int

ItemCount

Number of items in this sector

public int ItemCount { get; }

Property Value

int

MapIndex

Map index this sector belongs to

public int MapIndex { get; }

Property Value

int

MobileCount

Number of mobiles in this sector

public int MobileCount { get; }

Property Value

int

PlayerCount

Number of players in this sector

public int PlayerCount { get; }

Property Value

int

SectorX

Sector X coordinate

public int SectorX { get; }

Property Value

int

SectorY

Sector Y coordinate

public int SectorY { get; }

Property Value

int

Methods

AddEntity(IPositionEntity)

Adds an entity to this sector

public void AddEntity(IPositionEntity entity)

Parameters

entity IPositionEntity

ContainsPoint(Point3D)

Checks if a point is within this sector's bounds

public bool ContainsPoint(Point3D point)

Parameters

point Point3D

Returns

bool

GetAllEntities()

Gets all entities in this sector (for debugging/admin tools)

public IReadOnlyCollection<IPositionEntity> GetAllEntities()

Returns

IReadOnlyCollection<IPositionEntity>

GetEntitiesInRange<T>(Point3D, int)

Gets all entities of a specific type within range of a point

public List<T> GetEntitiesInRange<T>(Point3D center, int range) where T : class, IPositionEntity

Parameters

center Point3D
range int

Returns

List<T>

Type Parameters

T

GetEntity<T>(Serial)

Gets a specific entity by serial

public T? GetEntity<T>(Serial serial) where T : class, IPositionEntity

Parameters

serial Serial

Returns

T

Type Parameters

T

GetItems()

Gets all items in this sector

public IReadOnlyCollection<UOItemEntity> GetItems()

Returns

IReadOnlyCollection<UOItemEntity>

GetMobiles()

Gets all mobiles in this sector

public IReadOnlyCollection<UOMobileEntity> GetMobiles()

Returns

IReadOnlyCollection<UOMobileEntity>

GetPlayers()

Gets all players in this sector

public IReadOnlyCollection<UOMobileEntity> GetPlayers()

Returns

IReadOnlyCollection<UOMobileEntity>

GetPlayersInRange(Point3D, int)

Gets all players in this sector within range of a point

public List<UOMobileEntity> GetPlayersInRange(Point3D center, int range)

Parameters

center Point3D
range int

Returns

List<UOMobileEntity>

GetStats()

Gets sector statistics for monitoring

public SectorStats GetStats()

Returns

SectorStats

RemoveEntity(IPositionEntity)

Removes an entity from this sector

public void RemoveEntity(IPositionEntity entity)

Parameters

entity IPositionEntity

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.