FrameIT
Fact Class Referenceabstract

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

Inheritance diagram for Fact:
FactWrappedCRTP< T >

Public Member Functions

string GetLabel (FactRecorder name_space)
 
bool SetLabel (string value, FactRecorder name_space)
 
Fact ReInitializeMe (Dictionary< string, string > old_to_new, FactRecorder organizer)
 Copies fact by initiating new MMT Fact. More...
 
bool rename (string newLabel, FactRecorder name_space)
 Assignes a custom GetLabel, if newLabel is not yet taken; or clears custom GetLabel. More...
 
abstract MMTFact MakeMMTDeclaration ()
 
abstract SOMDoc Defines ()
 
abstract bool Equivalent (Fact f2)
 Compares this against f2 . More...
 
abstract bool Equivalent (Fact f1, Fact f2)
 Compares f1 against f2 . More...
 
virtual new int GetHashCode ()
 canonical More...
 
virtual SOMDoc GetMMTType ()
 
void freeAutoLabel (FactRecorder name_space)
 Tells a FactRecorder that this no longer uses auto-generated GetLabel, but remembers current generation variable(s). More...
 
void SendToMMT ()
 

Static Public Member Functions

static IEnumerator parseFact (List< Fact > ret, MMTFact fact)
 Parses MMTFact to actual Fact More...
 
static SOMDoc SendToMMT (MMTFact mmtDecl)
 
static void MakeFact (List< Fact > ret, object payload, SOMDoc ServerDefinition, bool BypassServer, SOMDoc BypassURI=null)
 Tries to parse payload into Fact(s) More...
 
static List< FactMMTFactory (MMTFact ingredient)
 Compiles/Executes ingredient and parses result into @Fact s More...
 

Public Attributes

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

Static Public Attributes

static readonly Type[] Types = TypeExtensions<Fact>.UAssemblyInheritenceTypes
 Collection of Types of all available Facts to choose from. More...
 

Protected Member Functions

virtual object GetCompiledValue ()
 
object CompileValue (SOMDoc compile_me)
 
abstract string[] GetDependentFactIds ()
 
 Fact ()
 Only being used by JsonReader to initiate empty Facts.

See also
SOMDocManager
More...
 
abstract Fact _ReInitializeMe (Dictionary< string, string > old_to_new)
 
abstract void RecalculateTransform ()
 
virtual string generateLabel (FactRecorder name_space)
 auto-generates GetLabel using generation variable(s) e.g. LabelId; if custom GetLabel is set, tries to restore original generated GetLabel without resetting _CustomLabel. If original GetLabel is already taken, a new one will be generated. More...
 

Protected Attributes

string s_type
 
string _CustomLabel = null
 Stores custom GetLabel if set. More...
 

Package Attributes

string _LastLabel = "NaN"
 

Properties

Expression? CompileBase [getprotected set]
 
object CompiledValue [getprotected set]
 
virtual bool HasDependentFacts [get]
 
Returns
true if Fact depends on other Facts; equivalent to getDependentFactIds returns non empty array
More...
 
string[] DependentFactIds [get]
 
string??? Id [get]
 Unique Id. e.g.: MMT URI More...
 
SOMDoc ServerDefinition [getprotected set]
 AST which the Server understands. e.g.: OMS(MMT URI) More...
 
MMTFact ScalaFact [getprotected set]
 
bool HasServerTwin [get]
 
bool hasCustomLabel [get]
 
int LabelId [getset]
 Counter to organize auto generated GetLabel. Set to negative, if custom Label is assigned. More...
 
Vector3 Position [getprotected set]
 
Quaternion Rotation [getprotected set]
 
Vector3 LocalScale [getprotected set]
 

Private Member Functions

 ~Fact ()
 Frees ressources e.g. GetLabel and will eventually delete Fact Server-Side in far-near future when feature is supported. More...
 

Private Attributes

Expression _CompileBase
 
object _CompiledValue
 
string[] _DependentFactIds
 
SOMDoc _ServerDefinition = null
 
MMTFact _ScalaFact = null
 
bool ForceRecalculateTransform = true
 
Vector3 _Position = Vector3.zero
 
Quaternion _Rotation = Quaternion.identity
 
Vector3 _LocalScale = Vector3.one
 
bool SendedToMMT = false
 

Static Private Attributes

static readonly List< Type > ServerBlacklist
 
static uint bypasscc = 0
 Used by MakeFact(List<Fact>, object, SOMDoc, bool, SOMDoc) to create unique pseudo-URIs / Ids. More...
 

Detailed Description

Fact representation of Unity; mostly mirrors Facts of MMT.

Constructor & Destructor Documentation

◆ Fact()

Fact.Fact ( )
protected

Only being used by JsonReader to initiate empty Facts.

See also
SOMDocManager

◆ ~Fact()

Fact.~Fact ( )
private

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

Member Function Documentation

◆ _ReInitializeMe()

abstract Fact Fact._ReInitializeMe ( Dictionary< string, string >  old_to_new)
protectedpure virtual

◆ CompileValue()

object Fact.CompileValue ( SOMDoc  compile_me)
protected

◆ Defines()

abstract SOMDoc Fact.Defines ( )
pure virtual

◆ 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 ( FactRecorder  name_space)

Tells a FactRecorder that this no longer uses auto-generated GetLabel, but remembers current generation variable(s).

◆ generateLabel()

virtual string Fact.generateLabel ( FactRecorder  name_space)
protectedvirtual

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

Returns
auto-generated GetLabel

◆ GetCompiledValue()

virtual object Fact.GetCompiledValue ( )
protectedvirtual

◆ GetDependentFactIds()

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

AngleFact needs 3 PointFacts to be defined.

◆ GetHashCode()

virtual new int Fact.GetHashCode ( )
virtual

canonical

Returns
unique-ish Hash

◆ GetLabel()

string Fact.GetLabel ( FactRecorder  name_space)

get initiates and subsequently updates a human readable name. set calls rename(string, FactRecorder)

◆ GetMMTType()

virtual SOMDoc Fact.GetMMTType ( )
virtual

◆ MakeFact()

static void Fact.MakeFact ( List< Fact ret,
object  payload,
SOMDoc  ServerDefinition,
bool  BypassServer,
SOMDoc  BypassURI = null 
)
static

Tries to parse payload into Fact(s)

Parameters
retto add results to
payloadto be parsed
ServerDefinitionwhat the Server could use. Only relevant for certain types of payload .
BypassServeriff true avoids Server-side initialization
BypassURIiff BypassServer ==true used as Server reference; iff set null a unique pseudo reference will be generated
Exceptions
NotImplementedExceptioniff payload is of unhandled type

◆ MakeMMTDeclaration()

abstract MMTFact Fact.MakeMMTDeclaration ( )
pure virtual

◆ MMTFactory()

static List< Fact > Fact.MMTFactory ( MMTFact  ingredient)
static

Compiles/Executes ingredient and parses result into @Fact s

Parameters
ingredientMMT package to be interpreted
Returns
containing all @Fact s succesfully parsed, or empty when failed.

◆ parseFact()

static IEnumerator Fact.parseFact ( List< Fact ret,
MMTFact  fact 
)
static

Parses MMTFact to actual Fact

Parameters
factinstance to be parsed
Returns
parsed Fact

◆ RecalculateTransform()

abstract void Fact.RecalculateTransform ( )
protectedpure virtual

◆ ReInitializeMe()

Fact Fact.ReInitializeMe ( Dictionary< string, string >  old_to_new,
FactRecorder  organizer 
)

Copies fact by initiating new MMT Fact.

Parameters
factFact to be copied
old_to_newDictionary mapping fact .getDependentFactIds to corresponding Fact.Id in organizer
organizerfor LabelingGetLabel(FactRecorder)

◆ rename()

bool Fact.rename ( string  newLabel,
FactRecorder  name_space 
)

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

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

◆ SendToMMT() [1/2]

void Fact.SendToMMT ( )

◆ SendToMMT() [2/2]

static SOMDoc Fact.SendToMMT ( MMTFact  mmtDecl)
static

Asynchron version has proofen inefficent, since Fact.Id is usually called in close proximity.

◆ SetLabel()

bool Fact.SetLabel ( string  value,
FactRecorder  name_space 
)

Member Data Documentation

◆ _CompileBase

Expression Fact._CompileBase
private

◆ _CompiledValue

object Fact._CompiledValue
private

◆ _CustomLabel

string Fact._CustomLabel = null
protected

Stores custom GetLabel if set.

◆ _DependentFactIds

string [] Fact._DependentFactIds
private

◆ _LastLabel

string Fact._LastLabel = "NaN"
package

◆ _LocalScale

Vector3 Fact._LocalScale = Vector3.one
private

◆ _Position

Vector3 Fact._Position = Vector3.zero
private

◆ _Rotation

Quaternion Fact._Rotation = Quaternion.identity
private

◆ _ScalaFact

MMTFact Fact._ScalaFact = null
private

◆ _ServerDefinition

SOMDoc Fact._ServerDefinition = null
private

◆ bypasscc

uint Fact.bypasscc = 0
staticprivate

Used by MakeFact(List<Fact>, object, SOMDoc, bool, SOMDoc) to create unique pseudo-URIs / Ids.

◆ ForceRecalculateTransform

bool Fact.ForceRecalculateTransform = true
private

◆ s_type

string Fact.s_type
protected

[ClassName] for JSON de-/serialization. Automatically set in Fact() for NON-Generiy-Types! Also add JsonSubtypes.KnownSubType decorator for deserialization to Fact!

◆ SendedToMMT

bool Fact.SendedToMMT = false
private

◆ ServerBlacklist

readonly List<Type> Fact.ServerBlacklist
staticprivate
Initial value:
= new()
{
typeof(FunctionFact),
}
Binds a domain mapper (FunctionFact) opperating on time t in seconds to a FunctionFact....
Definition: FunctionFact.cs:15
A function Func<object[], object[]> as Fact.
Definition: FunctionFact.cs:194

◆ Types

readonly Type [] Fact.Types = TypeExtensions<Fact>.UAssemblyInheritenceTypes
static

Collection of Types of all available Facts to choose from.

◆ WorldRepresentation

FactWrapper Fact.WorldRepresentation

Reference to GameObject that represents this Fact in the GameWorld.

See also
FactObject3D

Property Documentation

◆ CompileBase

Expression? Fact.CompileBase
getprotected set

◆ CompiledValue

object Fact.CompiledValue
getprotected set

◆ DependentFactIds

string [] Fact.DependentFactIds
get
Returns
array of Fact Ids on which this Fact depends.

AngleFact needs 3 PointFacts to be defined.

◆ hasCustomLabel

bool Fact.hasCustomLabel
get

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

◆ HasDependentFacts

virtual bool Fact.HasDependentFacts
get

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

◆ HasServerTwin

bool Fact.HasServerTwin
get

◆ Id

string??? Fact.Id
get

Unique Id. e.g.: MMT URI

◆ LabelId

int Fact.LabelId
getset

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

◆ LocalScale

Vector3 Fact.LocalScale
getprotected set

◆ Position

Vector3 Fact.Position
getprotected set

◆ Rotation

Quaternion Fact.Rotation
getprotected set

◆ ScalaFact

MMTFact Fact.ScalaFact
getprotected set

◆ ServerDefinition

SOMDoc Fact.ServerDefinition
getprotected set

AST which the Server understands. e.g.: OMS(MMT URI)


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