Relationclassrelations.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  

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  makeUnique  relatedTo  removeRelation 

Inherited from ModuleExecObject :
_execute  classExec  execute 

Properties  

namerelations.t[24]

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

reciprocalrelations.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]

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

relTabrelations.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]

reverseNamerelations.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[119]

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[69]
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[105]
Test whether a is inversely related to b via this relation. [RELATIONS EXTENSION]

isRelated (a, b)relations.t[59]
Test whether a is related to b via this relation. [RELATIONS EXTENSION]

makeUnique (key, val)relations.t[298]
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[320]
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 01/03/2024 from adv3Lite version 1.6.2