16 lines
193 B
GDScript3
16 lines
193 B
GDScript3
![]() |
class_name Queue extends Object
|
||
|
|
||
|
var items: Array
|
||
|
|
||
|
func push(item):
|
||
|
items.append(item)
|
||
|
|
||
|
func pop():
|
||
|
return items.pop_front()
|
||
|
|
||
|
func peek():
|
||
|
return items[0]
|
||
|
|
||
|
func size():
|
||
|
return items.size()
|