I want to dynamically add classes to a project from the project itself

edited December 2013 in How To...

I am making a program to map nodes to a network, but the project is limited to not being able to add new types of nodes.

So I am looking for a way to create a new type of node from the program, and add it as a class file to the sketch folder. The only data the class will need to handle is a name and a list of variables, the methods for the class can be created using the list of variables.

A further problem is that containing a list of variables is going to be tricky, as the type of the variable will have to be stored as a String, and then operated on using a long list of if statements to find which type it is. But obviously this is going to be horrifically long, especially if there are ArrayLists or HashMaps for checking the types.

Has anyone attempted this before, or have any suggestions? Thanks.

Sign In or Register to comment.