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
A string name that can be used to refer to this relation, e.g. 'loves' or 'is the parent of' [RELATIONS EXTENSION]
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]
The type of relation we are; this can be one of oneToOne, oneToMany, manyToOne or manyToMany. [RELATIONS EXTENSION]
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]
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
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]
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]
Test whether a is inversely related to b via this relation. [RELATIONS EXTENSION]
Test whether a is related to b via this relation. [RELATIONS EXTENSION]
Ensure that key is the only entry in relTab with a value of [val]. [RELATIONS EXTENSION]
Return a list of items related to a via this relation. [RELATIONS EXTENSION]
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