aboutsummaryrefslogtreecommitdiff
path: root/game/src/Autoload/Arguments/ArgumentOption.gd
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-06-03 20:37:10 +0200
committer Spartan322 <Megacake1234@gmail.com>2023-06-03 20:37:10 +0200
commitcef940108fe15752c3ef66f43f5169403fa2f71d (patch)
treefe4de5a05830e3bddeae78f74f729503b7cee1e9 /game/src/Autoload/Arguments/ArgumentOption.gd
parent73e29d02e48739aba5ca5db1b9575c67e795400f (diff)
Reorganize the file structure of the files in `game/src`
Diffstat (limited to 'game/src/Autoload/Arguments/ArgumentOption.gd')
-rw-r--r--game/src/Autoload/Arguments/ArgumentOption.gd60
1 files changed, 0 insertions, 60 deletions
diff --git a/game/src/Autoload/Arguments/ArgumentOption.gd b/game/src/Autoload/Arguments/ArgumentOption.gd
deleted file mode 100644
index f14cef0..0000000
--- a/game/src/Autoload/Arguments/ArgumentOption.gd
+++ /dev/null
@@ -1,60 +0,0 @@
-@tool
-class_name ArgumentOption
-extends Resource
-
-@export var name : StringName
-@export var aliases : Array[StringName] = []
-@export var type : Variant.Type :
- get: return type
- set(v):
- type = v
- match v:
- TYPE_BOOL: default_value = false
- TYPE_INT: default_value = 0
- TYPE_FLOAT: default_value = 0.0
- TYPE_STRING: default_value = ""
- TYPE_STRING_NAME: default_value = &""
- TYPE_COLOR: default_value = Color()
- _: default_value = null
- notify_property_list_changed()
-var default_value
-@export var description : String
-
-func _init(_name = "", _type = TYPE_NIL, _description = "", default = null):
- name = _name
- type = _type
- if default != null and typeof(default) == type:
- default_value = default
- description = _description
-
-func add_alias(alias : StringName) -> ArgumentOption:
- aliases.append(alias)
- return self
-
-func get_type_string() -> StringName:
- match type:
- TYPE_NIL: return "null"
- TYPE_BOOL: return "boolean"
- TYPE_INT: return "integer"
- TYPE_FLOAT: return "float"
- TYPE_STRING, TYPE_STRING_NAME: return "string"
- TYPE_COLOR: return "color"
- return "<invalid type>"
-
-func _get(property):
- if property == "default_value": return default_value
-
-func _set(property, value):
- if property == "default_value":
- default_value = value
- return true
-
-func _get_property_list():
- var properties := []
-
- properties.append({
- "name": "default_value",
- "type": type
- })
-
- return properties