Newer
Older
in gadget: use Factadder
factadder adds the fact to the server, use standard method AddFactIfNotFound
fact: fact to add
samestep: if the fact belongs conceptually to the previously added one
Fact.cs: Caches all facts
see TestFact as an example
parseFact interprets new MMT fact.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--------------------------------------
In Assets\InteractionEngine\FactHandling\Facts create your own fact
First, add your scroll you Implemented into Assets\Scripts\MMTServer\CommunicationProtocal\MMTConstants.cs
Follow the definitions of previous srolls/functions.
Then, in Assets\InteractionEngine\FactHandling\Facts.ParsingDictionary.Dictionary add an entry with your
MMTConstant as key and the parseFact Method of the Fact class you're going to implement.
Then in Assets\InteractionEngine\FactHandling\Facts.ParsingDictionary add a line to the lines
that look like [JsonSubtypes,.KnownSubType(typeof(YOUR_FACTCLASS), nameof(YOUR_FACTCLASS))]
Your fact should include:
1.) A constructor that calls base(). Constructor can have SomDoc, which is the MMT URI as OMS.
2.) define: A method parseFact(List<Fact>, MMTFact fact).
Then, in this method, you will try to add your fact to the ParsingDictionary in Assets\InteractionEngine\FactHandling\Facts,
then add it to the first argument (the list).
3.) define: public override bool HasDependentFact => [true/false]
4.) define: GetDeendentFactIds(), which gives back a string array of the dependent Ids of your facts.
5.) define: GetHashCode()
6.) define: EquivalentWrapped(YOUR_FACTCLASS, YOUR_FACTCLASS), which is a Method that
returns true if the two facts are (approximately) equal
7.) define: _ReInitializeMe(Dictionary<string, string> old_to_new), that gets called when the Fact
gets reinstantiated
8.) define: MakeMMTDecalaration(), which gives back a new MMTFact
9.) define: Defines(), which gives back a SOMDoc(MMTObject) of your class
----------------------------------------------------------
1.) In Assets\InteractionEngine\FactHandling\Facts create your own fact. ()
2.)