I am currently trying to translate some text-based console-log processing into JSON format.
Console.log commands:
give ENTITY.name = "entitytest";
give entity.userid = 99;
give entity.storagenum = 22;
give ENTITY.behaviour = "GIVE entity.storagenum xp to USERID" WHEN entity2.quest = 22
The console input will be processed:
var translatedData = "READ FROM STRING";
result in this kind of translation:
{
'entity.name' = "entitytest",
entity.behaviour: {data: "give entity.storagenum xp to USERID", result: "give 22 xp to 99 when entity2 quest is 22",
when: ["entity2.quest": 22}],
}
Thoughts:
class to build it upon?behaviours and reasons behind the entity behaviour?
How would I be able to build this kind of functionality?
I have been trying with javascript, but typescript answers also work.