Skip to content

Rework Class Creature, Cylinder and Item from Raw Pointer to Smart Pointer #5019

@alysonjacomin

Description

@alysonjacomin
  • Change from Raw Pointer to Smart Pointer (Shared Pointer in this cases);
  • Use enable_shared_from_this for compatibility with Shared Pointer;
  • Use "weak_ptr" when necessary;
  • Create using "Class_ptr" for each Class;
  • Keep the object alive and send only the reference to subsequent functions with "Class_ptr&" to get the best performance + good naming semantics;
  • Create virtual function on Class Thing "getClass()" for each Class and Sub-Class, this way we avoid using dynamic_cast which is more expensive.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions