23 lines
539 B
GDScript
23 lines
539 B
GDScript
|
|
class_name LevelEntry extends Resource
|
||
|
|
|
||
|
|
# A single row from the 'levels' table of ahog.json.
|
||
|
|
|
||
|
|
@export var index: int = -1
|
||
|
|
@export var name: String = ""
|
||
|
|
@export var thumb: String = ""
|
||
|
|
|
||
|
|
func object_to_find() -> String:
|
||
|
|
return str(Global.database.scenes_for_level(index).size())
|
||
|
|
|
||
|
|
func object_finding() -> String:
|
||
|
|
var count := 0
|
||
|
|
for s in Global.database.scenes_for_level(index):
|
||
|
|
if s.lock:
|
||
|
|
count += 1
|
||
|
|
return str(count)
|
||
|
|
|
||
|
|
func reset() -> void:
|
||
|
|
for s in Global.database.scenes_for_level(index):
|
||
|
|
s.lock = false
|
||
|
|
Global.database.save()
|