Queue.front Shared function

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

This function was added in version: 0.1.0

Method gets first element from the queue class.

Syntax

element queue.front()

Returns

First element pushed into the queue.

Example

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

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

	print(test_queue.front()); // this will print "first" because it's getting first value from the queue

});

Related functions