xparq / Out_of_Nothing

Versatile entity-based simulation & visualization/gamification framework PROTOTYPE
0 stars 0 forks source link

Divide the model update() into 2-3 parts (at least) #554

Closed xparq closed 9 months ago

xparq commented 9 months ago

OK, it's now:

void World::update(float dt, SimApp& app)
{
    update_before_interactions(dt, app);
    update_pairwise_interactions(dt, app);
    update_after_interactions(dt, app);
}

What it really means in practice (currently) is

void World::update(float dt, SimApp& app)
{
    update_entities_before_interactions(dt, app);
    update_pairwise_entity_interactions(dt, app);
    update_entities_after_interactions(dt, app);
}

but that'd be overly specific -- which is both good and bad, though: good for clarity, bad for apparently missing even more functions to update some global properties of the world, not just the entities, and bad also for prematurely "crystallizing" the logic, making it rigid/brittle.