Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
js/ts translate internal commands

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:

  • How will I create this class to build it upon?
  • How can I do the nesting, with multiple 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.
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda