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

Method AddPathNode

Source/Utils/micropather.cpp:398–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396
397
398void PathNodePool::AddPathNode( unsigned key, PathNode* root )
399{
400 if ( hashTable[key] ) {
401 PathNode* p = hashTable[key];
402 while( true ) {
403 int dir = (root->state < p->state) ? 0 : 1;
404 if ( p->child[dir] ) {
405 p = p->child[dir];
406 }
407 else {
408 p->child[dir] = root;
409 break;
410 }
411 }
412 }
413 else {
414 hashTable[key] = root;
415 }
416}
417
418
419PathNode* PathNodePool::FetchPathNode( cPosition state )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected