extends Resource
class_name Flags

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

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

@export var prevent_sleep_mode: bool = false

signal alarm_added(alarm)
signal alarm_removed(alarm)

func _changed():
	emit_changed()

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

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