FrameIT
Fact Class Referenceabstract

Fact representation of Unity; mostly mirrors Facts of MMT. More...

Inheritance diagram for Fact:
FactWrappedCRTP< T >

Public Member Functions

bool rename (string newLabel)
 Assignes a custom Label, if newLabel is not yet taken; or clears custom Label. More...
 
abstract bool hasDependentFacts ()
 
Returns
true if Fact depends on other Facts; equivalent to getDependentFactIds returns non empty array
More...
 
abstract string[] getDependentFactIds ()
 
abstract GameObject instantiateDisplay (GameObject prefab, Transform transform)
 Initiates a prefab at transform e.g. by setting Label. More...
 
virtual void delete (bool keep_clean=true)
 Frees ressources e.g. Label and will eventually delete Fact Server-Side in far-near future when feature is supported. More...
 
abstract bool Equivalent (Fact f2)
 Compares this against f2 . More...
 
abstract bool Equivalent (Fact f1, Fact f2)
 Compares f1 against f2 . More...
 
abstract override int GetHashCode ()
 canonical More...
 
void freeAutoLabel ()
 Tells _Facts that this no longer uses auto-generated Label, but remembers current generation variable(s). More...
 

Static Public Member Functions

static Fact parseFact (Scroll.ScrollFact fact)
 Parses Scroll.ScrollFact to actual Fact More...
 

Public Attributes

GameObject Representation
 Reference to GameObject that represents this Fact in the GameWorld. More...
 

Protected Member Functions

 Fact ()
 Only being used by JsonReader to initiate empty Facts.

See also
JSONManager
More...
 
 Fact (FactOrganizer organizer)
 Standard base-constructor. More...
 
 Fact (Fact fact, FactOrganizer organizer)
 Copies fact by initiating new MMT Fact. More...
 
virtual string generateLabel ()
 auto-generates Label using generation variable(s) e.g. LabelId; if custom Label is set, tries to restore original generated Label without resetting _CustomLabel. If original Label is already taken, a new one will be generated. More...
 

Protected Attributes

string _URI
 MMT URI More...
 
string _CustomLabel = null
 Stores custom Label if set. More...
 
FactOrganizer _Facts
 Reference to FactOrganizer in which this Fact and all its depending Facts are beeing organized. More...
 

Properties

string Id [getset]
 
string? Label [getset]
 
bool hasCustomLabel [get]
 
int LabelId [getset]
 Counter to organize auto generated Label. Set to negative, if custom Label is assigned. More...
 

Detailed Description

Fact representation of Unity; mostly mirrors Facts of MMT.

Constructor & Destructor Documentation

◆ Fact() [1/3]

Fact.Fact ( )
protected

Only being used by JsonReader to initiate empty Facts.

See also
JSONManager

◆ Fact() [2/3]

Fact.Fact ( FactOrganizer  organizer)
protected

Standard base-constructor.

Parameters
organizer_Facts

◆ Fact() [3/3]

Fact.Fact ( Fact  fact,
FactOrganizer  organizer 
)
protected

Copies fact by initiating new MMT Fact.

Parameters
factFact to be copied
organizer_Facts

Member Function Documentation

◆ delete()

virtual void Fact.delete ( bool  keep_clean = true)
virtual

Frees ressources e.g. Label and will eventually delete Fact Server-Side in far-near future when feature is supported.

Parameters
keep_cleanwhen set to true will upkeep Label organization.

◆ Equivalent() [1/2]

abstract bool Fact.Equivalent ( Fact  f1,
Fact  f2 
)
pure virtual

Compares f1 against f2 .

Parameters
f1Fact to compare to
f2Fact to compare to
Returns
true if f2 is semantical very similar to f1

Implemented in FactWrappedCRTP< T >.

◆ Equivalent() [2/2]

abstract bool Fact.Equivalent ( Fact  f2)
pure virtual

Compares this against f2 .

Parameters
f2Fact to compare to
Returns
true if f2 is semantical very similar to this

Implemented in FactWrappedCRTP< T >.

◆ freeAutoLabel()

void Fact.freeAutoLabel ( )

Tells _Facts that this no longer uses auto-generated Label, but remembers current generation variable(s).

◆ generateLabel()

virtual string Fact.generateLabel ( )
protectedvirtual

auto-generates Label using generation variable(s) e.g. LabelId; if custom Label is set, tries to restore original generated Label without resetting _CustomLabel. If original Label is already taken, a new one will be generated.

Returns
auto-generated Label

◆ getDependentFactIds()

abstract string[] Fact.getDependentFactIds ( )
pure virtual
Returns
array of Fact Ids on which this Fact depends.

AngleFact needs 3 PointFacts to be defined.

◆ GetHashCode()

abstract override int Fact.GetHashCode ( )
pure virtual

canonical

Returns
unique-ish Hash

◆ hasDependentFacts()

abstract bool Fact.hasDependentFacts ( )
pure virtual

Returns
true if Fact depends on other Facts; equivalent to getDependentFactIds returns non empty array

◆ instantiateDisplay()

abstract GameObject Fact.instantiateDisplay ( GameObject  prefab,
Transform  transform 
)
pure virtual

Initiates a prefab at transform e.g. by setting Label.

Does not set Representation.

Parameters
prefabGameObject Prefab that will represent this Fact
transformTransform where to initiate prefab
Returns

◆ parseFact()

static Fact Fact.parseFact ( Scroll.ScrollFact  fact)
static

Parses Scroll.ScrollFact to actual Fact

Parameters
factinstance to be parsed
Returns
parsed Fact

◆ rename()

bool Fact.rename ( string  newLabel)

Assignes a custom Label, if newLabel is not yet taken; or clears custom Label.

Parameters
newLabelTo be new Label. To reset to auto-generation set to null or "".
Returns

Member Data Documentation

◆ _CustomLabel

string Fact._CustomLabel = null
protected

Stores custom Label if set.

◆ _Facts

FactOrganizer Fact._Facts
protected

Reference to FactOrganizer in which this Fact and all its depending Facts are beeing organized.

◆ _URI

string Fact._URI
protected

MMT URI

◆ Representation

GameObject Fact.Representation

Reference to GameObject that represents this Fact in the GameWorld.

See also
FactObject

Property Documentation

◆ hasCustomLabel

bool Fact.hasCustomLabel
get

Is true if Fact has a custom Label which is not null or "".

◆ Id

string Fact.Id
getset

Unique Id. e.g.: MMT URI

◆ Label

string? Fact.Label
getset

get initiates and subsequently updates a human readable name.

Should be called once a constructor call to be initiated.

set calls rename(string)

◆ LabelId

int Fact.LabelId
getset

Counter to organize auto generated Label. Set to negative, if custom Label is assigned.


The documentation for this class was generated from the following file: