User Tools

Site Tools


lgscript:linksrv

LinkSrv

The linkset type is an iterator for links. You can use a linkset as a standard iterator, or you can call the specific methods directly.

  • Done — Returns true when the linkset is empty.
  • Next — Advances to the next link.
  • Id — Return the current link ID.
  • Link — Return the destination, source, and flavor of the current link.
  • Data — Return the data associated with the current link. May be a table.
  • Release — Close the resources used by the iterator.

The Release method will usually be called automatically when your function returns. A linkset should not be used after the function it is created in returns. When used directly by a for-in loop, the iterator values are the link ID, destination, and source.

Create

Add a link.

Returns integer or nil link
Parameter string or integer flavor
Parameter integer source
Parameter integer destination

Destroy

Remove a link.

Returns boolean success
Parameter integer link

AnyExist

Check if there are links between two objects.

Returns boolean exists
Parameter string or integer flavor
Parameter integer source
Parameter integer destination (optional)

GetAll

Get an iterator for links between two objects.

Returns linkset iterator
Parameter string or integer flavor
Parameter integer source
Parameter integer destination (optional)

GetOne

Get the first link found between two objects.

Returns integer or nil link
Parameter string or integer flavor
Parameter integer source
Parameter integer destination (optional)

Send a script message to the destinations of links. If data is given, and the link flavor supports it, then the message is only sent to links that match the data.

Parameter integer source
Parameter string message
Parameter string or integer flavor
Parameter any data (optional)

CreateMany

Add many links at once.

Returns boolean success
Parameter string or integer flavor
Parameter string sources
Parameter string destinations

DestroyMany

Remove many links at once.

Returns boolean success
Parameter string or integer flavor
Parameter string sources
Parameter string destinations

GetAllInherited

Get an iterator for links between objects and the objects that descend from them.

Returns linkset iterator
Parameter string or integer flavor
Parameter integer source
Parameter integer destination

GetAllInheritedSingle

Get an iterator for links between objects and the objects that descend from them. (How is this different from the other function?)

Returns linkset iterator
Parameter string or integer flavor
Parameter integer source
Parameter integer destination
lgscript/linksrv.txt · Last modified: 2009/09/19 01:45 by telliamed