MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / ClosedSet

Class ClosedSet

Source/Utils/micropather.cpp:168–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166
167
168class ClosedSet
169{
170 public:
171 ClosedSet( Graph* _graph ) { this->graph = _graph; }
172 ~ClosedSet() {}
173
174 void Add( PathNode* pNode )
175 {
176 #ifdef DEBUG_PATH_DEEP
177 printf( "Closed add: " );
178 graph->PrintStateInfo( pNode->state );
179 printf( " total=%.1f\n", pNode->totalCost );
180 #endif
181 #ifdef DEBUG
182 MPASSERT( pNode->inClosed == 0 );
183 MPASSERT( pNode->inOpen == 0 );
184 #endif
185 pNode->inClosed = 1;
186 }
187
188 void Remove( PathNode* pNode )
189 {
190 #ifdef DEBUG_PATH_DEEP
191 printf( "Closed remove: " );
192 graph->PrintStateInfo( pNode->state );
193 printf( " total=%.1f\n", pNode->totalCost );
194 #endif
195 MPASSERT( pNode->inClosed == 1 );
196 MPASSERT( pNode->inOpen == 0 );
197
198 pNode->inClosed = 0;
199 }
200
201 private:
202 ClosedSet( const ClosedSet& );
203 void operator=( const ClosedSet& );
204 Graph* graph;
205};
206
207
208PathNodePool::PathNodePool( unsigned _allocate, unsigned _typicalAdjacent )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected