





#include "xpathnodedynamic.h"

XPathNodeDynamic::XPathNodeDynamic()
    : XAsset() {
}

void XPathNodeDynamic::ParseData(QDataStream *aStream) {
    if (GetPtr() == -1) {
        // We can't directly read pointers from the stream, so we'll skip this
        aStream->ignore(sizeof(void*));

        aStream->read((char*)&mFreeTime, sizeof(int));
        aStream->read((char*)mValidTime, 3 * sizeof(int));
        aStream->read((char*)&mPlayerLostTime, sizeof(int));

        aStream->read((char*)&mLinkCount, sizeof(short));
        aStream->read((char*)&mOverlapCount, sizeof(short));
        aStream->read((char*)&mTurretEntNumber, sizeof(short));
        aStream->read((char*)&mUserCount, sizeof(short));
    }
}

void* XPathNodeDynamic::GetOwner() const {
    return mOwner;
}

void XPathNodeDynamic::SetOwner(void* owner) {
    mOwner = owner;
}

int XPathNodeDynamic::GetFreeTime() const {
    return mFreeTime;
}

void XPathNodeDynamic::SetFreeTime(int time) {
    mFreeTime = time;
}

const int* XPathNodeDynamic::GetValidTime() const {
    return mValidTime;
}

void XPathNodeDynamic::SetValidTime(const int* times, size_t count) {
    if (count <= 3) {
        memcpy(mValidTime, times, count * sizeof(int));
    }
}

int XPathNodeDynamic::GetPlayerLostTime() const {
    return mPlayerLostTime;
}

void XPathNodeDynamic::SetPlayerLostTime(int time) {
    mPlayerLostTime = time;
}

short XPathNodeDynamic::GetLinkCount() const {
    return mLinkCount;
}

void XPathNodeDynamic::SetLinkCount(short count) {
    mLinkCount = count;
}

short XPathNodeDynamic::GetOverlapCount() const {
    return mOverlapCount;
}

void XPathNodeDynamic::SetOverlapCount(short count) {
    mOverlapCount = count;
}

short XPathNodeDynamic::GetTurretEntNumber() const {
    return mTurretEntNumber;
}

void XPathNodeDynamic::SetTurretEntNumber(short number) {
    mTurretEntNumber = number;
}

short XPathNodeDynamic::GetUserCount() const {
    return mUserCount;
}

void XPathNodeDynamic::SetUserCount(short count) {
    mUserCount = count;
}



