





#include "xpathnodetransient.h"

XPathNodeTransient::XPathNodeTransient()
    : XAsset() {
}

void XPathNodeTransient::ParseData(QDataStream *aStream) {
    if (GetPtr() == -1) {
        aStream->read((char*)&mSearchFrame, sizeof(int));

        // We can't directly read pointers from the stream, so we'll skip these
        aStream->ignore(sizeof(pathnode_t*));
        aStream->ignore(sizeof(pathnode_t*));
        aStream->ignore(sizeof(pathnode_t*));

        aStream->read((char*)&mCost, sizeof(float));
        aStream->read((char*)&mHeuristic, sizeof(float));
        aStream->read((char*)&mCostFactor, sizeof(float));
    }
}

int XPathNodeTransient::GetSearchFrame() const {
    return mSearchFrame;
}

void XPathNodeTransient::SetSearchFrame(int frame) {
    mSearchFrame = frame;
}

pathnode_t* XPathNodeTransient::GetNextOpen() const {
    return mNextOpen;
}

void XPathNodeTransient::SetNextOpen(pathnode_t* node) {
    mNextOpen = node;
}

pathnode_t* XPathNodeTransient::GetPrevOpen() const {
    return mPrevOpen;
}

void XPathNodeTransient::SetPrevOpen(pathnode_t* node) {
    mPrevOpen = node;
}

pathnode_t* XPathNodeTransient::GetParent() const {
    return mParent;
}

void XPathNodeTransient::SetParent(pathnode_t* parent) {
    mParent = parent;
}

float XPathNodeTransient::GetCost() const {
    return mCost;
}

void XPathNodeTransient::SetCost(float cost) {
    mCost = cost;
}

float XPathNodeTransient::GetHeuristic() const {
    return mHeuristic;
}

void XPathNodeTransient::SetHeuristic(float heuristic) {
    mHeuristic = heuristic;
}

float XPathNodeTransient::GetCostFactor() const {
    return mCostFactor;
}

void XPathNodeTransient::SetCostFactor(float factor) {
    mCostFactor = factor;
}




