Relation class | relations.t[19]

The Relation class is used to define any kind of binary relation you like between objects, or between items of any other kind, e.g. x love y, or a is the father of b, or c knows d.

REQUIRES THE RELATIONS EXTENSION.

`class Relation : PreinitObject`

Superclass Tree (in declaration order)

`Relation`
`PreinitObject`
`ModuleExecObject`
`object`

Subclass Tree

(none)

Global Objects

`contradicting DerivedRelation Signal`

Summary of Properties

`name reciprocal relationType relTab reverseName`

Inherited from `PreinitObject` :
`execBeforeMe reverseGlobalSymbols`

Inherited from `ModuleExecObject` :
`execAfterMe hasInitialized_ isDoingExec_ isExecuted_`

Summary of Methods

`addRelation inverselyRelatedTo isInverselyRelated isRelated listKeys makeUnique relatedTo removeRelation`

``

Inherited from `ModuleExecObject` :
`_execute classExec execute`

Properties

`name` | `relations.t[24]`

A string name that can be used to refer to this relation, e.g. 'loves' or 'is the parent of' [RELATIONS EXTENSION]

`reciprocal` | `relations.t[43]`

Flag: are we a reciprocal relation (i.e. does x relation b imply b relation x)? Note that only oneToOne and manyToMany relations can be reciprocal. [RELATIONS EXTENSION]

`relationType` | `relations.t[36]`

The type of relation we are; this can be one of oneToOne, oneToMany, manyToOne or manyToMany. [RELATIONS EXTENSION]

`relTab` | `relations.t[50]`

A LookupTable to hold data about the items related via this relation. This is maintained by the library code and shouldn't normally be directly accessed via game code. [RELATIONS EXTENSION]

`reverseName` | `relations.t[30]`

A string name that can be used to refer to this relation in reverse, e.g. 'loved by' or 'is a child of' [RELATIONS EXTENSION]

Methods

`addRelation (objs)` | `relations.t[122]`

Make two objects related via this relation. The objs should be supplied as a two-element list (e.g. [a, b]) such that a will be related to b. [RELATIONS EXTENSION]

`inverselyRelatedTo (a)` | `relations.t[81]`

Return a list of items inverselty related to a via this relation (e.g. if this is loving relation, return a list of the people a is loved by. [RELATIONS EXTENSION]

`isInverselyRelated (a, b)` | `relations.t[108]`

Test whether a is inversely related to b via this relation. [RELATIONS EXTENSION]

`isRelated (a, b)` | `relations.t[71]`

Test whether a is related to b via this relation. [RELATIONS EXTENSION]

`listKeys ( )` | `relations.t[384]`

Liat the keys (the items to which this relation applies). By default we list the keys in our relTab.

`makeUnique (key, val)` | `relations.t[301]`

Ensure that key is the only entry in relTab with a value of [val]. [RELATIONS EXTENSION]

`relatedTo (a)` | `relations.t[53]`

Return a list of items related to a via this relation. [RELATIONS EXTENSION]

`removeRelation (objs)` | `relations.t[323]`

Remove this relation between the items specified in objs, which should be supplied as a two-element list [a, b], where a is the item that is no longer related to b. [RELATIONS EXTENSION]

Adv3Lite Library Reference Manual
Generated on 13/06/2025 from adv3Lite version 2.2.1