1
Fork 0
mirror of https://github.com/RYGhub/the-cold-night.git synced 2024-11-22 04:34:19 +00:00

🔧 Add utility static methods to Alliance

This commit is contained in:
Steffo 2022-04-03 08:47:28 +02:00
parent 60d3078825
commit 3e56b51c9b
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -1,10 +1,23 @@
extends Node
class_name Alliance
enum Alliance {
enum AllianceKind {
ENEMY = -1,
NONE = 0,
PLAYER = 1,
}
export(Alliance) var alliance: int
export(AllianceKind) var alliance: int
static func get_value(first) -> int:
var first_node = first.get_node("Alliance")
var first_alliance = null
if first_node != null:
first_alliance = first_node.alliance
return first_alliance
static func compare(first, second) -> bool:
return get_value(first) == get_value(second)