C# Class Aura.Channel.World.Region

Afficher le fichier Open project: aura-project/aura Class Usage Examples

Méthodes publiques

Свойство Type Description
Limbo Region

Protected Properties

Свойство Type Description
_clientEvents ClientEvent>.Dictionary
_clients HashSet
_creatures Creature>.Dictionary
_creaturesRWLS System.Threading.ReaderWriterLockSlim
_items Item>.Dictionary
_props Prop>.Dictionary

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

ActivateAis() public méthode

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
Résultat void

AddCreature() public méthode

Adds creature to region, sends EntityAppears.
public AddCreature ( Creature creature ) : void
creature Aura.Channel.World.Entities.Creature
Résultat void

AddItem() public méthode

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
Résultat void

AddProp() public méthode

Spawns prop, sends EntityAppears.
public AddProp ( Prop prop ) : void
prop Aura.Channel.World.Entities.Prop
Résultat void

Broadcast() public méthode

Broadcasts packet in region.
public Broadcast ( Aura.Shared.Network.Packet packet ) : void
packet Aura.Shared.Network.Packet
Résultat void

Broadcast() public méthode

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
Résultat void

CountAggro() public méthode

Returns amount of creatures of race that are targetting target in this region.
public CountAggro ( Creature target ) : int
target Aura.Channel.World.Entities.Creature
Résultat int

CountAggro() public méthode

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
Résultat int

CountPlayers() public méthode

Returns amount of players in region.
public CountPlayers ( ) : int
Résultat int

CreatureExists() public méthode

Returns true if creature with given entity id exists.
public CreatureExists ( long entityId ) : bool
entityId long
Résultat bool

GetAllGoodNpcs() public méthode

Adds all good NPCs of region to list.
public GetAllGoodNpcs ( List &list ) : void
list List
Résultat void

GetAllItems() public méthode

Returns a list of all items on the floor.
public GetAllItems ( ) : List
Résultat List

GetAllPlayers() public méthode

Returns all player creatures in region.
public GetAllPlayers ( ) : List
Résultat List

GetAreaId() public méthode

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
Résultat int

GetClientEvent() public méthode

Returns first event that matches the predicate.
public GetClientEvent ( bool>.Func predicate ) : Aura.Channel.World.Entities.ClientEvent
predicate bool>.Func
Résultat Aura.Channel.World.Entities.ClientEvent

GetClientEvent() public méthode

Returns event by id or null if it doesn't exist.
public GetClientEvent ( long eventId ) : Aura.Channel.World.Entities.ClientEvent
eventId long
Résultat Aura.Channel.World.Entities.ClientEvent

GetClientEvent() public méthode

Returns event by name or null if it doesn't exist.
public GetClientEvent ( string eventName ) : Aura.Channel.World.Entities.ClientEvent
eventName string
Résultat Aura.Channel.World.Entities.ClientEvent

GetClientEvents() public méthode

Returns all events that matches the predicate.
public GetClientEvents ( bool>.Func predicate ) : Aura.Channel.World.Entities.ClientEvent[]
predicate bool>.Func
Résultat Aura.Channel.World.Entities.ClientEvent[]

GetCreature() public méthode

Returns creature by entityId, or null, if it doesn't exist.
public GetCreature ( long entityId ) : Creature
entityId long
Résultat Aura.Channel.World.Entities.Creature

GetCreature() public méthode

Returns creature by name, or null, if it doesn't exist.
public GetCreature ( string name ) : Creature
name string
Résultat Aura.Channel.World.Entities.Creature

GetCreatureSafe() public méthode

Returns creature by entity id, throws SevereViolation exception if creature doesn't exist.
public GetCreatureSafe ( long entityId ) : Creature
entityId long
Résultat Aura.Channel.World.Entities.Creature

GetCreatures() public méthode

Returns list of creatures that match predicate.
public GetCreatures ( bool>.Func predicate ) : ICollection
predicate bool>.Func
Résultat ICollection

GetCreaturesInPolygon() public méthode

Returns new list of all creatures within the specified polygon.
public GetCreaturesInPolygon ( ) : List
Résultat List

GetCreaturesInRange() public méthode

Returns new list of all creatures within range of position.
public GetCreaturesInRange ( Position pos, int range ) : List
pos Position
range int
Résultat List

GetEntitiesInRange() public méthode

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.
Résultat List

GetItem() public méthode

Returns first item that matches predicate, or null if none were found.
public GetItem ( bool>.Func predicate ) : Item
predicate bool>.Func
Résultat Item

GetItem() public méthode

Returns item or null.
public GetItem ( long entityId ) : Item
entityId long
Résultat Item

GetMatchingEvents() public méthode

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
Résultat List

GetNpc() public méthode

Returns NPC by entityId, or null, if no NPC with that id exists.
public GetNpc ( long entityId ) : NPC
entityId long
Résultat Aura.Channel.World.Entities.NPC

GetNpcSafe() public méthode

Returns NPC by entity id, throws SevereViolation exception if NPC doesn't exist.
public GetNpcSafe ( long entityId ) : NPC
entityId long
Résultat Aura.Channel.World.Entities.NPC

GetNpcs() public méthode

Returns list of creatures that match predicate.
public GetNpcs ( bool>.Func predicate ) : ICollection
predicate bool>.Func
Résultat ICollection

GetPlayer() public méthode

Returns first player creature with the given name, or null.
public GetPlayer ( string name ) : Aura.Channel.World.Entities.PlayerCreature
name string
Résultat Aura.Channel.World.Entities.PlayerCreature

GetPlayersInRange() public méthode

Returns all player creatures in range.
public GetPlayersInRange ( Position pos, int range = VisibleRange ) : List
pos Position
range int
Résultat List

GetProp() public méthode

Returns first prop that matches the predicate, or null if no matching props were found.
public GetProp ( bool>.Func predicate ) : Prop
predicate bool>.Func
Résultat Aura.Channel.World.Entities.Prop

GetProp() public méthode

Returns prop or null.
public GetProp ( long entityId ) : Prop
entityId long
Résultat Aura.Channel.World.Entities.Prop

GetProps() public méthode

Returns list of all props that match the predicate.
public GetProps ( bool>.Func predicate ) : IList
predicate bool>.Func
Résultat IList

GetVisibleCreaturesInRange() public méthode

Returns all visible creatures in range of entity, excluding itself.
public GetVisibleCreaturesInRange ( Entity entity, int range = VisibleRange ) : ICollection
entity Entity
range int
Résultat ICollection

GetVisibleEntities() public méthode

Returns a list of visible entities, from the view point of creature.
public GetVisibleEntities ( Creature creature ) : List
creature Aura.Channel.World.Entities.Creature
Résultat List

InitializeFromData() protected méthode

Adds all props found in the client for this region and creates a list of areas.
protected InitializeFromData ( ) : void
Résultat void

IsOnStreet() public méthode

Returns true if given position is on the street.
public IsOnStreet ( Position pos ) : bool
pos Position
Résultat bool

LoadClientEvents() protected méthode

Adds all props found in the client for this region.
protected LoadClientEvents ( ) : void
Résultat void

LoadProps() protected méthode

Adds all props found in the client for this region.
protected LoadProps ( ) : void
Résultat void

OnPlayerEntered() public méthode

public OnPlayerEntered ( Creature creature, int prevRegionId ) : void
creature Aura.Channel.World.Entities.Creature
prevRegionId int
Résultat void

Region() protected méthode

Initializes class.
protected Region ( int regionId ) : System
regionId int
Résultat System

RemoveCreature() public méthode

Removes creature from region, sends EntityDisappears.
public RemoveCreature ( Creature creature ) : void
creature Aura.Channel.World.Entities.Creature
Résultat void

RemoveItem() public méthode

Despawns item, sends EntityDisappears.
public RemoveItem ( Item item ) : void
item Item
Résultat void

RemoveProp() public méthode

Despawns prop, sends EntityDisappears.
public RemoveProp ( Prop prop ) : void
prop Aura.Channel.World.Entities.Prop
Résultat void

RemoveScriptedEntities() public méthode

Removes all scripted entites from this region.
public RemoveScriptedEntities ( ) : void
Résultat void

UpdateEntities() public méthode

Updates all entites, removing dead ones, updating visibility, etc.
public UpdateEntities ( ) : void
Résultat void

Property Details

Limbo public_oe static_oe property

public static Region,Aura.Channel.World Limbo
Résultat Region

_clientEvents protected_oe property

protected Dictionary _clientEvents
Résultat ClientEvent>.Dictionary

_clients protected_oe property

protected HashSet _clients
Résultat HashSet

_creatures protected_oe property

protected Dictionary _creatures
Résultat Creature>.Dictionary

_creaturesRWLS protected_oe property

protected ReaderWriterLockSlim,System.Threading _creaturesRWLS
Résultat System.Threading.ReaderWriterLockSlim

_items protected_oe property

protected Dictionary _items
Résultat Item>.Dictionary

_props protected_oe property

protected Dictionary _props
Résultat Prop>.Dictionary