initial commit
This commit is contained in:
commit
de042a580c
22 changed files with 221 additions and 0 deletions
26
Crafter.Component-Component.cpp
Normal file
26
Crafter.Component-Component.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
module;
|
||||
|
||||
module Crafter.Component;
|
||||
|
||||
using namespace Crafter;
|
||||
|
||||
Component::Component() {
|
||||
|
||||
}
|
||||
|
||||
Component::~Component() {
|
||||
onDelete.Invoke();
|
||||
}
|
||||
|
||||
void Component::AddOwner()
|
||||
{
|
||||
refCount++;
|
||||
}
|
||||
|
||||
void Component::RemoveOwner()
|
||||
{
|
||||
refCount--;
|
||||
if (refCount == 0) {
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue