0
Vote

misc entity lifetime stuff

description

Should entities get their EntityDef in the constructor? That way then can initialize params to (class) defaults. Or should those params just get set in code?
 
Entities shouldn't need unique names, the hashtable of names->entities shouldn't be the main storage for them (use a linked list?, then we can have multiple dictionaries to search for entities by position / type). Right now it's hacked so doors have unique-ized names, so they can exist in the table.
 
Should entities add themselves to the hashtable(s) in the constructor? Right now we add each one after newing it. This isn't too important... maybe it's better to do it after we set the entity's position.
 
Entities should be destroyed (but saved?) on map changes, right now the doors are left over
 
Is there code we can simplify by event-izing or delegate-izing it?

comments