void BuildOrderQueue::queueAsHighestPriority(const BuildType & type, bool blocking)
{
    // the new priority will be higher
    int newPriority = m_highestPriority + m_defaultPrioritySpacing;

    // queue the item
    queueItem(BuildOrderItem(type, newPriority, blocking));
}
Beispiel #2
0
void BuildOrderQueue::queueAsLowestPriority(MetaType m, bool blocking) 
{
	// the new priority will be higher
	int newPriority = lowestPriority - defaultPrioritySpacing;

	// queue the item
	queueItem(BuildOrderItem<PRIORITY_TYPE>(m, newPriority, blocking));
}
void QueueItem::update(SubLevel* subLevel_p) {
	//add itself to the queue if enabled, disable self afterwards
	if(getEnabled()) {
		setEnabled(false);

		auto entity_wp = subLevel_p->getEntity(mQueueName);
		auto queue_p = static_cast<Queue*>(entity_wp.lock().get());

		queue_p->queueItem(subLevel_p, this);
	}
}