void nobBaseWarehouse::OrderCarrier(noRoadNode& goal, RoadSegment& workplace)
{
    RTTR_Assert(workplace.getCarrier(0) == NULL);
    const bool isBoatRequired = workplace.GetRoadType() == RoadSegment::RT_BOAT;

    // We assume, that the caller already checked, if this is possible
    RTTR_Assert(inventory[JOB_HELPER]);
    if(isBoatRequired)
        RTTR_Assert(inventory[GD_BOAT]);

    nofCarrier* carrier = new nofCarrier(isBoatRequired ? nofCarrier::CT_BOAT : nofCarrier::CT_NORMAL, pos, player, &workplace, &goal);
    workplace.setCarrier(0, carrier);

    if(!UseFigureAtOnce(carrier, goal))
        AddLeavingFigure(carrier);

    inventory.real.Remove(JOB_HELPER);
    if(isBoatRequired)
        inventory.real.Remove(GD_BOAT);

    // Evtl. kein Gehilfe mehr, sodass das Rekrutieren gestoppt werden muss
    TryStopRecruiting();
}
예제 #2
0
 bool operator()(const RoadSegment& segment) const
 {
     return segment.GetRoadType() != T_roadType;
 }