Simutrans in JAVA?
Reply #7 –
Why? As used in SImutrans it workes quite nicely.
Like any object can be a ding_t and a steppable_t for animation. Why is this bad? It reduces code like
if( dynamic_cast<factory *>(obj)) {
factory *fab = dynamic_cast<factory *>(obj);
if(fab->is_steppable()) {
fab->sync_step();
}
else if( dynamic_cast<vehicle *>(obj)) {
vehicle *veh = dynamic_cast<vehicle *>(obj);
if(veh->is_steppable()) {
veh->sync_step();
}
} ...
As with any tools it depends on how you are using it. You can also use electricity for electrocution or defibrillator ...
And I fear the JAVA garbage collector would suck on the several millions of objects on larger maps.