public void SimTick() { if (_tickDelay > 0) { --_tickDelay; return; } if (mState == EState.WAIT_FOR_DELIVERY) { _abandonState = EState.WAIT_FOR_DELIVERY; CPickup pickup = mWorld.GetPickupWithBuildTag(mBuildTag); if (pickup != null && pickup.IsReady()) { // TODO: Check if blueprint and pickup are in the same pathing room. // Pass that info to make sure we get a builder in the same room. CUnit builder = _GetTaskAcceptingUnit(mWorld, mPlayerID, 0); if (builder != null) { builder.SetBuildOrder(this); mState = EState.TRANSIT_TO_BUILD_SITE; return; } } _tickDelay = 20; } else if (mState == EState.TRANSIT_TO_BUILD_SITE) { _abandonState = EState.WAIT_FOR_DELIVERY; // Wait for builder to pickup the pickup, do the delivery, and begin building. // Wait for builder to tell us status things. } else if (mState == EState.START_PACKUP) { _abandonState = EState.START_PACKUP; } }