Queue.pop Shared function

From Gothic 2 Online: Wiki
Jump to navigation Jump to search

This function was added in version: 0.1.0

Method removes first element from the queue.

Syntax

void queue.pop()

Example

addEventHandler("onInit",function(pid)
{
	local test_queue = queue();

	test_queue.push("first"); // this three lines are adding some values into queue one by one.
	test_queue.push("second");
	test_queue.push("last");

	test_queue.pop() // this line remove "first" value from queue (now "second" is the first value in queue)
	print(test_queue.front()) // this will print "second", because we removed "first" value from queue.

});

Related functions