I always wanted to write a simple world in Java, but then I could start the “world” and then add new objects (which were not there when the world started working) at a later date (simulate / observe different behaviors between future objects) .
The problem is that I do not want to ever stop or restart the world after it starts, I want it to work for a week without recompiling it, but be able to drop objects and remodel / rewrite / delete / create / mutate them with time.
The world may be as simple as a 10 x 10 x / y 'location' array (think of a chessboard), but I probably need some kind of ticktimer process to monitor objects and give everyone (if any) a chance to "act "(if they want).
Example: I code up World.java on Monday and leave it turned on. Then on Tuesday I write a new class called Rock.java (which does not move). Then I throw it (somehow) into this already running world (which just discards it randomly in a 10x10 array and never moves).
Then on Wednesday I create a new class called Cat.java and delete it in a world randomly placed again, but this new object can move around the world (for some unit of time), then on Thursday I write a class called Dog.java , which also moves, but can "act" on another object if it is in a neighboring location and vice versa.
Here is the thing. I don’t know what type of structure / design I will need to encode a real world class, to know how to define / load / track future objects.
So, any ideas on how you will do something like this?
d33j
source share