Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
32
addons/godot-twicil/helpers/queue.gd
Normal file
32
addons/godot-twicil/helpers/queue.gd
Normal file
|
@ -0,0 +1,32 @@
|
|||
extends Object
|
||||
class_name Queue
|
||||
|
||||
var __queue = []
|
||||
var busy = false
|
||||
|
||||
func append(element)->void :
|
||||
if busy:
|
||||
return
|
||||
|
||||
busy = true
|
||||
|
||||
__queue.append(element)
|
||||
|
||||
busy = false
|
||||
|
||||
func pop_next():
|
||||
if busy:
|
||||
return
|
||||
|
||||
busy = true
|
||||
|
||||
var element = __queue[0]
|
||||
|
||||
__queue.pop_front()
|
||||
|
||||
busy = false
|
||||
|
||||
return element
|
||||
|
||||
func is_empty()->bool:
|
||||
return __queue.size() == 0
|
Loading…
Add table
Add a link
Reference in a new issue