XPlor/libs/xassets/xpathnodetransient.cpp

90 lines
1.7 KiB
C++
Raw Normal View History

2025-08-17 13:14:17 -04:00
#include "xpathnodetransient.h"
2025-09-05 18:35:17 -04:00
#include "xpathnode.h"
2025-08-17 13:14:17 -04:00
XPathNodeTransient::XPathNodeTransient()
2025-09-05 18:35:17 -04:00
: XAsset()
, mSearchFrame(0)
, mNextOpen(new XPathNode())
, mPrevOpen(new XPathNode())
, mParent(new XPathNode())
, mCost(0.0f)
, mHeuristic(0.0f)
, mCostFactor(0.0f)
{
2025-08-17 13:14:17 -04:00
}
2025-09-05 18:35:17 -04:00
XPathNodeTransient::~XPathNodeTransient()
{
2025-08-17 13:14:17 -04:00
2025-09-05 18:35:17 -04:00
}
2025-08-17 13:14:17 -04:00
2025-09-05 18:35:17 -04:00
void XPathNodeTransient::ParseData(QDataStream *aStream) {
if (GetPtr() == -1) {
qint32 node1Ptr, node2Ptr, node3Ptr;
*aStream
>>mSearchFrame
>>node1Ptr
>>node2Ptr
>>node3Ptr
>>mCost
>>mHeuristic
>>mCostFactor;
2025-08-17 13:14:17 -04:00
}
}
int XPathNodeTransient::GetSearchFrame() const {
return mSearchFrame;
}
void XPathNodeTransient::SetSearchFrame(int frame) {
mSearchFrame = frame;
}
2025-09-05 18:35:17 -04:00
XPathNode* XPathNodeTransient::GetNextOpen() const {
2025-08-17 13:14:17 -04:00
return mNextOpen;
}
2025-09-05 18:35:17 -04:00
void XPathNodeTransient::SetNextOpen(XPathNode* node) {
2025-08-17 13:14:17 -04:00
mNextOpen = node;
}
2025-09-05 18:35:17 -04:00
XPathNode* XPathNodeTransient::GetPrevOpen() const {
2025-08-17 13:14:17 -04:00
return mPrevOpen;
}
2025-09-05 18:35:17 -04:00
void XPathNodeTransient::SetPrevOpen(XPathNode* node) {
2025-08-17 13:14:17 -04:00
mPrevOpen = node;
}
2025-09-05 18:35:17 -04:00
XPathNode* XPathNodeTransient::GetParent() const {
2025-08-17 13:14:17 -04:00
return mParent;
}
2025-09-05 18:35:17 -04:00
void XPathNodeTransient::SetParent(XPathNode* parent) {
2025-08-17 13:14:17 -04:00
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;
}