ErorcecaspZes
New Member
I've built a system that parses a XML file into a Script class (described above). That file contains information about the scripting language (Javascript, Python etc) that is being used and the code it should run.Then, I've built another system that runs a Script class, using the name and version provided, I can detect the correct engine to be used. Finally, after thinking and thinking of how to solve my problems, I failed to achieve so, therefore I ask your help.Let me show you the current design\[code\]class Script { String content; Language language; class Language { String name; String version; }}class Effect { Script initial; Script final;}class Usuable { Script onUse; Script onHit;}\[/code\]Necessities:
- I want to be able to work with multiple languages and versions.
- An Effect class therefore contains 2 Script classes instances. Those scripts are run multiple times.
- The same applies for the Usuable class.
- Scripts on the Usuable class may be the same of the ones used on Effect.
- A Script may call another script while running.
- Scripts should be able to recieve parameters to work with.
- Effect, Usuable and Script classes are loaded from XML files.