diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-07-01 02:43:29 +0100 |
commit | 5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch) | |
tree | 62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2RoutingTableElem.cpp | |
parent | c0c336500955a23e344651e5412c9d9d441ef4ee (diff) | |
download | t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip |
i am in hell
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2RoutingTableElem.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/T2DLL/T2RoutingTableElem.cpp b/src/T2DLL/T2RoutingTableElem.cpp new file mode 100644 index 0000000..93a2489 --- /dev/null +++ b/src/T2DLL/T2RoutingTableElem.cpp @@ -0,0 +1,40 @@ +#include "T2RoutingTableElem.h" + +T2RoutingTableElem::T2RoutingTableElem() { + mNextFloorID = 0; + mScore = 0; + mTime = 0; + mFinalHPos = 0; +} + +T2RoutingTableElem::~T2RoutingTableElem() { +} + +BOOL T2RoutingTableElem::IsStopFloor() const { + return ((mNextFloorID != 0) && (mScore == 0)); +} + +void T2RoutingTableElem::SetTable(unsigned int inNextFloorID, int inFinalHPos) { + mNextFloorID = inNextFloorID; + mScore = 0; + mTime = 0; + mFinalHPos = inFinalHPos; +} + +BOOL T2RoutingTableElem::IsSetTable(unsigned int inNextFloorID, unsigned int inScore, int inTime, int inFinalHPos) { + BOOL result = false; + + if (mNextFloorID == 0 || mScore > inScore) { + mNextFloorID = inNextFloorID; + mScore = inScore; + mTime = inTime; + mFinalHPos = inFinalHPos; + result = true; + } + + return result; +} + +BOOL T2RoutingTableElem::HasNextRoute(unsigned int inFloorID) const { + return (mNextFloorID != 0) && (mNextFloorID != inFloorID); +} |