Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpreting commands (#) from outside (game developer) #51

Closed
BlackRam-oss opened this issue Oct 17, 2024 · 0 comments · Fixed by #54
Closed

Interpreting commands (#) from outside (game developer) #51

BlackRam-oss opened this issue Oct 17, 2024 · 0 comments · Fixed by #54

Comments

@BlackRam-oss
Copy link
Contributor

Commands are "the lines that start with #. Currently commands are "interpreted" by the convertListStringToObj function. This function transforms a command string into an array of strings (checking for double spaces, double quotes, single quotes, etc.), and then from the array makes a set of if statements to understand the command.

duration 3 name "C J" surname Smith position "{ x: 2, y 3 }"

["duration", "3", "x", "2", "y", "3", "name", "C J", "surname", "Smith", "position", "{ x: 2, y 3 }"]

if it is not a known command it ignores it.

the developer should be given the possibility to insert his own commands or modify the existing ones.

to do this you need to add the possibility to set a function that takes as input an array of strings (duration 3 name "C J" surname Smith position "{ x: 2, y 3 }") and returns a boolean (if it is true then it means that the command is known)

this function should be run in convertListStringToObj if it returns true then it will not check the array otherwise it will continue

@BlackRam-oss BlackRam-oss changed the title Interpreting commands (#) from outside Interpreting commands (#) from outside (game developer) Oct 17, 2024
@BlackRam-oss BlackRam-oss linked a pull request Oct 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant