extends Resource
class_name Flags

export var api_key :String
export var location := "Leiden"
export var alarms := []
export var automatic_dark_mode := false

export var show_celsius := true
export var show_fahrenheit := true
export var use_12_hour_clock := true

export var prevent_sleep_mode := false

signal alarm_added(alarm)
signal alarm_removed(alarm)

func _changed():
	emit_signal("changed")

func add_alarm(new:Alarm)->bool:
	if not new in alarms:
		alarms.append(new)
		emit_signal("alarm_added", new)
		_changed()
		return true
	return false

func remove_alarm(current:Alarm)->bool:
	if current in alarms:
		alarms.erase(current)
		emit_signal("alarm_removed", current)
		_changed()
		return true
	return false
