src/WorkerManager.cpp
Unit WorkerManager::getBuilder(Building & b, bool setJobAsBuilder) const
{
    Unit builderWorker = getClosestMineralWorkerTo(Util::GetPosition(b.finalPosition));

    // if the worker exists (one may not have been found in rare cases)
    if (builderWorker.isValid() && setJobAsBuilder)
    {
        m_workerData.setWorkerJob(builderWorker, WorkerJobs::Build, b.builderUnit);	// b.builderUnit is actually not used
    }

    return builderWorker;
}
// gets a builder for BuildingManager to use
// if setJobAsBuilder is true (default), it will be flagged as a builder unit
// set 'setJobAsBuilder' to false if we just want to see which worker will build a building
gets a builder for BuildingManager to use
if setJobAsBuilder is true (default), it will be flagged as a builder unit
set 'setJobAsBuilder' to false if we just want to see which worker will build a building
gets a builder for BuildingManager to use if setJobAsBuilder is true ( default ) it will be flagged as a builder unit set ' setJobAsBuilder ' to false if we just want to see which worker will build a building
Unit WorkerManager::getBuilder(Building & b, bool setJobAsBuilder) const
{
    Unit builderWorker = getClosestMineralWorkerTo(Util::GetPosition(b.finalPosition));
    if (builderWorker.isValid() && setJobAsBuilder)
    {
        m_workerData.setWorkerJob(builderWorker, WorkerJobs::Build, b.builderUnit);	
    }
    return builderWorker;
}
Unit WorkerManager :: getBuilder ( Building & b , bool setJobAsBuilder ) const { Unit builderWorker = getClosestMineralWorkerTo ( Util :: GetPosition ( b . finalPosition ) ) ; if ( builderWorker . isValid ( ) && setJobAsBuilder ) { m_workerData . setWorkerJob ( builderWorker , WorkerJobs :: Build , b . builderUnit ) ; } return builderWorker ; }
gets a builder for BuildingManager to use
if setJobAsBuilder is true (default), it will be flagged as a builder unit
set 'setJobAsBuilder' to false if we just want to see which worker will build a building
gets a builder for BuildingManager to use if setJobAsBuilder is true ( default ) it will be flagged as a builder unit set ' setJobAsBuilder ' to false if we just want to see which worker will build a building
// if the worker exists (one may not have been found in rare cases) // b.builderUnit is actually not used