From edc036941f5c94d13c3c5c5324b1dc05363ee71b Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 3 Apr 2022 08:47:39 +0200 Subject: [PATCH] :wrench: Add utility static methods to `Ownership` --- src/entities/behaviours/Ownership.gd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/entities/behaviours/Ownership.gd b/src/entities/behaviours/Ownership.gd index a59626c..bf77084 100644 --- a/src/entities/behaviours/Ownership.gd +++ b/src/entities/behaviours/Ownership.gd @@ -1,4 +1,13 @@ extends Node +class_name Ownership var entity_owner: Node = null + + +static func get_value(first) -> Node: + var first_node = first.get_node("Ownership") + var first_alliance = null + if first_node != null: + first_alliance = first_node.alliance + return first_alliance