src/WorkerManager.cpp
void WorkerManager::setMineralWorker(const Unit & unit)
{
    // check if there is a mineral available to send the worker to
    auto depot = getClosestDepot(unit);

    // if there is a valid mineral
    if (depot.isValid())
    {
        // update m_workerData with the new job
        m_workerData.setWorkerJob(unit, WorkerJobs::Minerals, depot);
    }
}
// set a worker to mine minerals
set a worker to mine minerals
set a worker to mine minerals
void WorkerManager::setMineralWorker(const Unit & unit)
{
    auto depot = getClosestDepot(unit);
    if (depot.isValid())
    {
        m_workerData.setWorkerJob(unit, WorkerJobs::Minerals, depot);
    }
}
void WorkerManager :: setMineralWorker ( const Unit & unit ) { auto depot = getClosestDepot ( unit ) ; if ( depot . isValid ( ) ) { m_workerData . setWorkerJob ( unit , WorkerJobs :: Minerals , depot ) ; } }
set a worker to mine minerals
set a worker to mine minerals
// check if there is a mineral available to send the worker to // if there is a valid mineral // update m_workerData with the new job