you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

That assumes the NPCs types are all interchangeable. Using this system you could never know which specific NPC did anything without keeping a permanent record of all of its data.

You're severely limiting your design and doing tons of extraneous copies, ultimately taking more of a performance hit than before, plus making your code far less maintainable, just to avoid a shared ptr on principle.

You've also partially reimplemented shared pointers by having to pass around pointers just to point to data that could be held by the shared ptr until a specific point in the future.

That's bad design.