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:
parent
60d3078825
commit
3e56b51c9b
1 changed files with 15 additions and 2 deletions
|
@ -1,10 +1,23 @@
|
||||||
extends Node
|
extends Node
|
||||||
|
class_name Alliance
|
||||||
|
|
||||||
|
|
||||||
enum Alliance {
|
enum AllianceKind {
|
||||||
ENEMY = -1,
|
ENEMY = -1,
|
||||||
NONE = 0,
|
NONE = 0,
|
||||||
PLAYER = 1,
|
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)
|
||||||
|
|
Loading…
Reference in a new issue