Photon Server API
Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
Photon.MmoDemo.Server.InterestArea Class Reference

Subscribes to regions in the area. Each region relays events of items in region. Thread safety: All instance members require a lock on SyncRoot. More...

Inheritance diagram for Photon.MmoDemo.Server.InterestArea:
Photon.MmoDemo.Server.ClientInterestArea

Public Member Functions

void AttachToItem (Item item)
 Attaching an Item to the InterestArea automatically updates the InterestArea's Position when the Item moves. More...
 
void Detach ()
 Detaches the InterestArea from an Item that was attached with AttachToItem. More...
 
void UpdateInterestManagement ()
 Updates the Region subscriptions that are used to detect Items in the nearby World. This method should be called after changing the InterestArea's Position. More...
 
void Dispose ()
 
virtual void OnItemEnter (ItemSnapshot snapshot)
 Item enters area More...
 
virtual void OnItemExit (Item item)
 Item exits area More...
 

Public Attributes

readonly object SyncRoot = new object()
 

Protected Member Functions

 InterestArea (byte id, World world)
 
virtual void Dispose (bool disposing)
 Disposes the fiber used to manage the subscriptions, detaches any attached item and resolves all existing channel subscriptions. More...
 
virtual void OnRegionEnter (Region region)
 Region enters area. More...
 
virtual void OnRegionExit (Region region)
 Region exits area. More...
 

Properties

Item AttachedItem [get]
 
byte Id [get]
 
Vector Position [get, set]
 
Vector ViewDistanceEnter [get, set]
 Gets or sets the inner view distance (the item subscribe threshold). More...
 
Vector ViewDistanceExit [get, set]
 Gets or sets the outer view distance (the item unsubscribe threshold). More...
 

Detailed Description

Subscribes to regions in the area. Each region relays events of items in region. Thread safety: All instance members require a lock on SyncRoot.

Constructor & Destructor Documentation

Photon.MmoDemo.Server.InterestArea.InterestArea ( byte  id,
World  world 
)
inlineprotected

Member Function Documentation

void Photon.MmoDemo.Server.InterestArea.AttachToItem ( Item  item)
inline

Attaching an Item to the InterestArea automatically updates the InterestArea's Position when the Item moves.

Detach the item with Detach. Thread safety: Requires enqueuing on the item's Item.Fiber and like all instance members a lock on SyncRoot.

void Photon.MmoDemo.Server.InterestArea.Detach ( )
inline

Detaches the InterestArea from an Item that was attached with AttachToItem.

void Photon.MmoDemo.Server.InterestArea.Dispose ( )
inline
virtual void Photon.MmoDemo.Server.InterestArea.Dispose ( bool  disposing)
inlineprotectedvirtual

Disposes the fiber used to manage the subscriptions, detaches any attached item and resolves all existing channel subscriptions.

virtual void Photon.MmoDemo.Server.InterestArea.OnItemEnter ( ItemSnapshot  snapshot)
inlinevirtual

Item enters area

Reimplemented in Photon.MmoDemo.Server.ClientInterestArea.

virtual void Photon.MmoDemo.Server.InterestArea.OnItemExit ( Item  item)
inlinevirtual

Item exits area

Reimplemented in Photon.MmoDemo.Server.ClientInterestArea.

virtual void Photon.MmoDemo.Server.InterestArea.OnRegionEnter ( Region  region)
inlineprotectedvirtual

Region enters area.

Reimplemented in Photon.MmoDemo.Server.ClientInterestArea.

virtual void Photon.MmoDemo.Server.InterestArea.OnRegionExit ( Region  region)
inlineprotectedvirtual

Region exits area.

Reimplemented in Photon.MmoDemo.Server.ClientInterestArea.

void Photon.MmoDemo.Server.InterestArea.UpdateInterestManagement ( )
inline

Updates the Region subscriptions that are used to detect Items in the nearby World. This method should be called after changing the InterestArea's Position.

Member Data Documentation

readonly object Photon.MmoDemo.Server.InterestArea.SyncRoot = new object()

Property Documentation

Item Photon.MmoDemo.Server.InterestArea.AttachedItem
get
byte Photon.MmoDemo.Server.InterestArea.Id
get
Vector Photon.MmoDemo.Server.InterestArea.Position
getset
Vector Photon.MmoDemo.Server.InterestArea.ViewDistanceEnter
getset

Gets or sets the inner view distance (the item subscribe threshold).

Vector Photon.MmoDemo.Server.InterestArea.ViewDistanceExit
getset

Gets or sets the outer view distance (the item unsubscribe threshold).