summaryrefslogtreecommitdiff
path: root/src/KingSystem/ActorSystem/actBaseProcHandle.cpp
blob: 35a1b13d0babcf309e7910975c32d362c47e5771 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "KingSystem/ActorSystem/actBaseProcHandle.h"
#include "KingSystem/ActorSystem/actBaseProcUnit.h"
#include "KingSystem/Utils/InitTimeInfo.h"

namespace ksys::act {

static util::InitTimeInfo sInfo;

BaseProcHandle::BaseProcHandle() {
    mUnit = nullptr;
    mFlag = 0;
}

BaseProcHandle::~BaseProcHandle() {
    if (mUnit) {
        mUnit->deleteProc(0, this);
        mUnit = nullptr;
    }
    mFlag = 0;
}

bool BaseProcHandle::procReady() {
    return mUnit && mUnit->isReady();
}

BaseProc* BaseProcHandle::getProc() {
    if (mUnit)
        return mUnit->getProc();

    return nullptr;
}

}  // namespace ksys::act