C# Класс Aura.Channel.World.Region

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
Limbo Region

Защищенные свойства (Protected)

Свойство Тип Описание
_clientEvents ClientEvent>.Dictionary
_clients HashSet
_creatures Creature>.Dictionary
_creaturesRWLS System.Threading.ReaderWriterLockSlim
_items Item>.Dictionary
_props Prop>.Dictionary

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

Метод Описание
ActivateAis ( Creature creature, Position from, Position to ) : void

Activates AIs in range of the movement path.

AddCreature ( Creature creature ) : void

Adds creature to region, sends EntityAppears.

AddItem ( Item item ) : void

Adds item, sends EntityAppears.

Use Item's Drop method to drop items in a region, unless you know what you're doing.

AddProp ( Prop prop ) : void

Spawns prop, sends EntityAppears.

Broadcast ( Aura.Shared.Network.Packet packet ) : void

Broadcasts packet in region.

Broadcast ( Aura.Shared.Network.Packet packet, Entity source, bool sendToSource = true, int range = -1 ) : void

Broadcasts packet to all creatures in range of source.

CountAggro ( Creature target ) : int

Returns amount of creatures of race that are targetting target in this region.

CountAggro ( Creature target, int raceId ) : int

Returns amount of creatures of race that are targetting target in this region.

CountPlayers ( ) : int

Returns amount of players in region.

CreatureExists ( long entityId ) : bool

Returns true if creature with given entity id exists.

GetAllGoodNpcs ( List &list ) : void

Adds all good NPCs of region to list.

GetAllItems ( ) : List

Returns a list of all items on the floor.

GetAllPlayers ( ) : List

Returns all player creatures in region.

GetAreaId ( int x, int y ) : int

Returns id of area at the given coordinates and adjusts it if region is dynamic, or 0 if area wasn't found.

GetClientEvent ( bool>.Func predicate ) : Aura.Channel.World.Entities.ClientEvent

Returns first event that matches the predicate.

GetClientEvent ( long eventId ) : Aura.Channel.World.Entities.ClientEvent

Returns event by id or null if it doesn't exist.

GetClientEvent ( string eventName ) : Aura.Channel.World.Entities.ClientEvent

Returns event by name or null if it doesn't exist.

GetClientEvents ( bool>.Func predicate ) : Aura.Channel.World.Entities.ClientEvent[]

Returns all events that matches the predicate.

GetCreature ( long entityId ) : Creature

Returns creature by entityId, or null, if it doesn't exist.

GetCreature ( string name ) : Creature

Returns creature by name, or null, if it doesn't exist.

GetCreatureSafe ( long entityId ) : Creature

Returns creature by entity id, throws SevereViolation exception if creature doesn't exist.

GetCreatures ( bool>.Func predicate ) : ICollection

Returns list of creatures that match predicate.

GetCreaturesInPolygon ( ) : List

Returns new list of all creatures within the specified polygon.

GetCreaturesInRange ( Position pos, int range ) : List

Returns new list of all creatures within range of position.

GetEntitiesInRange ( Entity source, int range = -1 ) : List

Returns new list of all entities within range of source.

GetItem ( bool>.Func predicate ) : Item

Returns first item that matches predicate, or null if none were found.

GetItem ( long entityId ) : Item

Returns item or null.

GetMatchingEvents ( string eventPath ) : List

Returns a list of events that start with the given path, e.g. "Uladh_main/field_Tir_S_aa/fish_tircho_stream_", to get all fishing events starting with that name.

GetNpc ( long entityId ) : NPC

Returns NPC by entityId, or null, if no NPC with that id exists.

GetNpcSafe ( long entityId ) : NPC

Returns NPC by entity id, throws SevereViolation exception if NPC doesn't exist.

GetNpcs ( bool>.Func predicate ) : ICollection

Returns list of creatures that match predicate.

GetPlayer ( string name ) : Aura.Channel.World.Entities.PlayerCreature

Returns first player creature with the given name, or null.

GetPlayersInRange ( Position pos, int range = VisibleRange ) : List

Returns all player creatures in range.

GetProp ( bool>.Func predicate ) : Prop

Returns first prop that matches the predicate, or null if no matching props were found.

GetProp ( long entityId ) : Prop

Returns prop or null.

GetProps ( bool>.Func predicate ) : IList

Returns list of all props that match the predicate.

GetVisibleCreaturesInRange ( Entity entity, int range = VisibleRange ) : ICollection

Returns all visible creatures in range of entity, excluding itself.

GetVisibleEntities ( Creature creature ) : List

Returns a list of visible entities, from the view point of creature.

IsOnStreet ( Position pos ) : bool

Returns true if given position is on the street.

OnPlayerEntered ( Creature creature, int prevRegionId ) : void
RemoveCreature ( Creature creature ) : void

Removes creature from region, sends EntityDisappears.

RemoveItem ( Item item ) : void

Despawns item, sends EntityDisappears.

RemoveProp ( Prop prop ) : void

Despawns prop, sends EntityDisappears.

RemoveScriptedEntities ( ) : void

Removes all scripted entites from this region.

UpdateEntities ( ) : void

Updates all entites, removing dead ones, updating visibility, etc.

Защищенные методы

Метод Описание
InitializeFromData ( ) : void

Adds all props found in the client for this region and creates a list of areas.

LoadClientEvents ( ) : void

Adds all props found in the client for this region.

LoadProps ( ) : void

Adds all props found in the client for this region.

Region ( int regionId ) : System

Initializes class.

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

Метод Описание
AddClientEvent ( Aura.Channel.World.Entities.ClientEvent clientEvent ) : void

Adds client event to region.

GetNewPropEntityId ( Prop prop ) : long

Generates entity id for prop.

RemoveOverdueEntities ( ) : void

Removes expired entities.

UpdateVisibility ( ) : void

Updates visible entities on all clients.

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

ActivateAis() публичный метод

Activates AIs in range of the movement path.
public ActivateAis ( Creature creature, Position from, Position to ) : void
creature Aura.Channel.World.Entities.Creature
from Position
to Position
Результат void

AddCreature() публичный метод

Adds creature to region, sends EntityAppears.
public AddCreature ( Creature creature ) : void
creature Aura.Channel.World.Entities.Creature
Результат void

AddItem() публичный метод

Adds item, sends EntityAppears.
Use Item's Drop method to drop items in a region, unless you know what you're doing.
public AddItem ( Item item ) : void
item Item
Результат void

AddProp() публичный метод

Spawns prop, sends EntityAppears.
public AddProp ( Prop prop ) : void
prop Aura.Channel.World.Entities.Prop
Результат void

Broadcast() публичный метод

Broadcasts packet in region.
public Broadcast ( Aura.Shared.Network.Packet packet ) : void
packet Aura.Shared.Network.Packet
Результат void

Broadcast() публичный метод

Broadcasts packet to all creatures in range of source.
public Broadcast ( Aura.Shared.Network.Packet packet, Entity source, bool sendToSource = true, int range = -1 ) : void
packet Aura.Shared.Network.Packet
source Entity
sendToSource bool
range int
Результат void

CountAggro() публичный метод

Returns amount of creatures of race that are targetting target in this region.
public CountAggro ( Creature target ) : int
target Aura.Channel.World.Entities.Creature
Результат int

CountAggro() публичный метод

Returns amount of creatures of race that are targetting target in this region.
public CountAggro ( Creature target, int raceId ) : int
target Aura.Channel.World.Entities.Creature
raceId int
Результат int

CountPlayers() публичный метод

Returns amount of players in region.
public CountPlayers ( ) : int
Результат int

CreatureExists() публичный метод

Returns true if creature with given entity id exists.
public CreatureExists ( long entityId ) : bool
entityId long
Результат bool

GetAllGoodNpcs() публичный метод

Adds all good NPCs of region to list.
public GetAllGoodNpcs ( List &list ) : void
list List
Результат void

GetAllItems() публичный метод

Returns a list of all items on the floor.
public GetAllItems ( ) : List
Результат List

GetAllPlayers() публичный метод

Returns all player creatures in region.
public GetAllPlayers ( ) : List
Результат List

GetAreaId() публичный метод

Returns id of area at the given coordinates and adjusts it if region is dynamic, or 0 if area wasn't found.
public GetAreaId ( int x, int y ) : int
x int
y int
Результат int

GetClientEvent() публичный метод

Returns first event that matches the predicate.
public GetClientEvent ( bool>.Func predicate ) : Aura.Channel.World.Entities.ClientEvent
predicate bool>.Func
Результат Aura.Channel.World.Entities.ClientEvent

GetClientEvent() публичный метод

Returns event by id or null if it doesn't exist.
public GetClientEvent ( long eventId ) : Aura.Channel.World.Entities.ClientEvent
eventId long
Результат Aura.Channel.World.Entities.ClientEvent

GetClientEvent() публичный метод

Returns event by name or null if it doesn't exist.
public GetClientEvent ( string eventName ) : Aura.Channel.World.Entities.ClientEvent
eventName string
Результат Aura.Channel.World.Entities.ClientEvent

GetClientEvents() публичный метод

Returns all events that matches the predicate.
public GetClientEvents ( bool>.Func predicate ) : Aura.Channel.World.Entities.ClientEvent[]
predicate bool>.Func
Результат Aura.Channel.World.Entities.ClientEvent[]

GetCreature() публичный метод

Returns creature by entityId, or null, if it doesn't exist.
public GetCreature ( long entityId ) : Creature
entityId long
Результат Aura.Channel.World.Entities.Creature

GetCreature() публичный метод

Returns creature by name, or null, if it doesn't exist.
public GetCreature ( string name ) : Creature
name string
Результат Aura.Channel.World.Entities.Creature

GetCreatureSafe() публичный метод

Returns creature by entity id, throws SevereViolation exception if creature doesn't exist.
public GetCreatureSafe ( long entityId ) : Creature
entityId long
Результат Aura.Channel.World.Entities.Creature

GetCreatures() публичный метод

Returns list of creatures that match predicate.
public GetCreatures ( bool>.Func predicate ) : ICollection
predicate bool>.Func
Результат ICollection

GetCreaturesInPolygon() публичный метод

Returns new list of all creatures within the specified polygon.
public GetCreaturesInPolygon ( ) : List
Результат List

GetCreaturesInRange() публичный метод

Returns new list of all creatures within range of position.
public GetCreaturesInRange ( Position pos, int range ) : List
pos Position
range int
Результат List

GetEntitiesInRange() публичный метод

Returns new list of all entities within range of source.
public GetEntitiesInRange ( Entity source, int range = -1 ) : List
source Entity
range int Leave at default for visible range.
Результат List

GetItem() публичный метод

Returns first item that matches predicate, or null if none were found.
public GetItem ( bool>.Func predicate ) : Item
predicate bool>.Func
Результат Item

GetItem() публичный метод

Returns item or null.
public GetItem ( long entityId ) : Item
entityId long
Результат Item

GetMatchingEvents() публичный метод

Returns a list of events that start with the given path, e.g. "Uladh_main/field_Tir_S_aa/fish_tircho_stream_", to get all fishing events starting with that name.
public GetMatchingEvents ( string eventPath ) : List
eventPath string
Результат List

GetNpc() публичный метод

Returns NPC by entityId, or null, if no NPC with that id exists.
public GetNpc ( long entityId ) : NPC
entityId long
Результат Aura.Channel.World.Entities.NPC

GetNpcSafe() публичный метод

Returns NPC by entity id, throws SevereViolation exception if NPC doesn't exist.
public GetNpcSafe ( long entityId ) : NPC
entityId long
Результат Aura.Channel.World.Entities.NPC

GetNpcs() публичный метод

Returns list of creatures that match predicate.
public GetNpcs ( bool>.Func predicate ) : ICollection
predicate bool>.Func
Результат ICollection

GetPlayer() публичный метод

Returns first player creature with the given name, or null.
public GetPlayer ( string name ) : Aura.Channel.World.Entities.PlayerCreature
name string
Результат Aura.Channel.World.Entities.PlayerCreature

GetPlayersInRange() публичный метод

Returns all player creatures in range.
public GetPlayersInRange ( Position pos, int range = VisibleRange ) : List
pos Position
range int
Результат List

GetProp() публичный метод

Returns first prop that matches the predicate, or null if no matching props were found.
public GetProp ( bool>.Func predicate ) : Prop
predicate bool>.Func
Результат Aura.Channel.World.Entities.Prop

GetProp() публичный метод

Returns prop or null.
public GetProp ( long entityId ) : Prop
entityId long
Результат Aura.Channel.World.Entities.Prop

GetProps() публичный метод

Returns list of all props that match the predicate.
public GetProps ( bool>.Func predicate ) : IList
predicate bool>.Func
Результат IList

GetVisibleCreaturesInRange() публичный метод

Returns all visible creatures in range of entity, excluding itself.
public GetVisibleCreaturesInRange ( Entity entity, int range = VisibleRange ) : ICollection
entity Entity
range int
Результат ICollection

GetVisibleEntities() публичный метод

Returns a list of visible entities, from the view point of creature.
public GetVisibleEntities ( Creature creature ) : List
creature Aura.Channel.World.Entities.Creature
Результат List

InitializeFromData() защищенный метод

Adds all props found in the client for this region and creates a list of areas.
protected InitializeFromData ( ) : void
Результат void

IsOnStreet() публичный метод

Returns true if given position is on the street.
public IsOnStreet ( Position pos ) : bool
pos Position
Результат bool

LoadClientEvents() защищенный метод

Adds all props found in the client for this region.
protected LoadClientEvents ( ) : void
Результат void

LoadProps() защищенный метод

Adds all props found in the client for this region.
protected LoadProps ( ) : void
Результат void

OnPlayerEntered() публичный метод

public OnPlayerEntered ( Creature creature, int prevRegionId ) : void
creature Aura.Channel.World.Entities.Creature
prevRegionId int
Результат void

Region() защищенный метод

Initializes class.
protected Region ( int regionId ) : System
regionId int
Результат System

RemoveCreature() публичный метод

Removes creature from region, sends EntityDisappears.
public RemoveCreature ( Creature creature ) : void
creature Aura.Channel.World.Entities.Creature
Результат void

RemoveItem() публичный метод

Despawns item, sends EntityDisappears.
public RemoveItem ( Item item ) : void
item Item
Результат void

RemoveProp() публичный метод

Despawns prop, sends EntityDisappears.
public RemoveProp ( Prop prop ) : void
prop Aura.Channel.World.Entities.Prop
Результат void

RemoveScriptedEntities() публичный метод

Removes all scripted entites from this region.
public RemoveScriptedEntities ( ) : void
Результат void

UpdateEntities() публичный метод

Updates all entites, removing dead ones, updating visibility, etc.
public UpdateEntities ( ) : void
Результат void

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

Limbo публичное статическое свойство

public static Region,Aura.Channel.World Limbo
Результат Region

_clientEvents защищенное свойство

protected Dictionary _clientEvents
Результат ClientEvent>.Dictionary

_clients защищенное свойство

protected HashSet _clients
Результат HashSet

_creatures защищенное свойство

protected Dictionary _creatures
Результат Creature>.Dictionary

_creaturesRWLS защищенное свойство

protected ReaderWriterLockSlim,System.Threading _creaturesRWLS
Результат System.Threading.ReaderWriterLockSlim

_items защищенное свойство

protected Dictionary _items
Результат Item>.Dictionary

_props защищенное свойство

protected Dictionary _props
Результат Prop>.Dictionary