mooege/mooege — Issue #325: WorldEntering rework
Author: Farmy
Created: 2011-11-09 02:28:10+00:00
State: open

The world entering logic is obfuscated and dangerous because it reveals unitialized objects to every player.
Currently, to add an actor to world you would pass a world in ctor, that is passed along to worldObject.cttor where a world property is set. That world property relies on it beeing overwritten in subclasses where to property setter has the sideeffeect of calling world.enter which then calles actor.OnEnterWorld()

- Exposes the object to be reveal()''ed before beeing fully initialited. So we would require another isInitialized property
- Properties having that much side effects is sort of against the principle of least surprise.

What would be the disadvantages of having World.AddActor(Actor) that works like one currently implemented plus
setting the world property.

That way you can create your actor and add it once it is inizialized.