From cea648f0ffc2ec69ab8d2315bfa174c5e440c100 Mon Sep 17 00:00:00 2001 From: Rendo Date: Fri, 25 Jul 2025 18:07:10 +0500 Subject: [PATCH] display resource renamed to entity resource --- scripts/gui/choose_your_seeds/Previewport.cs | 2 +- scripts/gui/seedpackets/Seedpacket.cs | 6 +++--- scripts/level/PlantField.cs | 4 ++-- .../resources/{DisplayResource.cs => EntityResource.cs} | 2 +- .../{DisplayResource.cs.uid => EntityResource.cs.uid} | 0 scripts/resources/PlantResource.cs | 2 +- scripts/resources/ZombieResource.cs | 2 +- scripts/systems/GameRegistry.cs | 8 ++++---- 8 files changed, 13 insertions(+), 13 deletions(-) rename scripts/resources/{DisplayResource.cs => EntityResource.cs} (91%) rename scripts/resources/{DisplayResource.cs.uid => EntityResource.cs.uid} (100%) diff --git a/scripts/gui/choose_your_seeds/Previewport.cs b/scripts/gui/choose_your_seeds/Previewport.cs index 4101aa8..ec162b7 100644 --- a/scripts/gui/choose_your_seeds/Previewport.cs +++ b/scripts/gui/choose_your_seeds/Previewport.cs @@ -26,7 +26,7 @@ public partial class Previewport : SubViewport } } - private void ChangeDisplay(DisplayResource resource) + private void ChangeDisplay(EntityResource resource) { // Expand with updates if (current_display != null) diff --git a/scripts/gui/seedpackets/Seedpacket.cs b/scripts/gui/seedpackets/Seedpacket.cs index 7384d26..98b37e3 100644 --- a/scripts/gui/seedpackets/Seedpacket.cs +++ b/scripts/gui/seedpackets/Seedpacket.cs @@ -8,7 +8,7 @@ public partial class Seedpacket : TextureButton public static AudioStream UntapStream = ResourceLoader.Load("res://assets/audio/gui/tap2.mp3"); public static AudioStream LiftStream = ResourceLoader.Load("res://assets/audio/gui/seedlift.mp3"); private const string PATH_TO_PACKED_SCENE = "res://scenes/gui/seedpacket.tscn"; - private DisplayResource _resource; + private EntityResource _resource; private Label _cost; private TextureRect _icon; private Timer _timer; @@ -46,14 +46,14 @@ public partial class Seedpacket : TextureButton } if (_handler is ISeedpacketProcess processHandler) processHandler.Process(); } - public void SetResource(DisplayResource resource) + public void SetResource(EntityResource resource) { _resource = resource; UpdateContents(); } - public DisplayResource GetResource() + public EntityResource GetResource() { return _resource; } diff --git a/scripts/level/PlantField.cs b/scripts/level/PlantField.cs index 0c7772f..20a2a6f 100644 --- a/scripts/level/PlantField.cs +++ b/scripts/level/PlantField.cs @@ -7,7 +7,7 @@ namespace Newlon.Components.Level; public partial class PlantField : Node2D { private Node2D _plantSetter; - private DisplayResource _resource; + private EntityResource _resource; private Seedpacket _slot; private bool _previousCanPlace; private ChannelPlayer player; @@ -21,7 +21,7 @@ public partial class PlantField : Node2D player = GetNode("PlantPlayer"); } - public void SetPlant(Seedpacket slot, DisplayResource resource) + public void SetPlant(Seedpacket slot, EntityResource resource) { _resource = resource; _slot = slot; diff --git a/scripts/resources/DisplayResource.cs b/scripts/resources/EntityResource.cs similarity index 91% rename from scripts/resources/DisplayResource.cs rename to scripts/resources/EntityResource.cs index afea310..1e61f35 100644 --- a/scripts/resources/DisplayResource.cs +++ b/scripts/resources/EntityResource.cs @@ -1,7 +1,7 @@ using Godot; [Tool] -public partial class DisplayResource : Resource +public partial class EntityResource : Resource { [Export] public string name_key; [Export] public string description_key; diff --git a/scripts/resources/DisplayResource.cs.uid b/scripts/resources/EntityResource.cs.uid similarity index 100% rename from scripts/resources/DisplayResource.cs.uid rename to scripts/resources/EntityResource.cs.uid diff --git a/scripts/resources/PlantResource.cs b/scripts/resources/PlantResource.cs index 1f1afa7..b6923d6 100644 --- a/scripts/resources/PlantResource.cs +++ b/scripts/resources/PlantResource.cs @@ -4,6 +4,6 @@ namespace Newlon; [GlobalClass] [Tool] -public partial class PlantResource : DisplayResource +public partial class PlantResource : EntityResource { } diff --git a/scripts/resources/ZombieResource.cs b/scripts/resources/ZombieResource.cs index 723656c..29f8804 100644 --- a/scripts/resources/ZombieResource.cs +++ b/scripts/resources/ZombieResource.cs @@ -2,6 +2,6 @@ using Godot; [GlobalClass] [Tool] -public partial class ZombieResource : DisplayResource +public partial class ZombieResource : EntityResource { } diff --git a/scripts/systems/GameRegistry.cs b/scripts/systems/GameRegistry.cs index d7b46fb..f6dbc63 100644 --- a/scripts/systems/GameRegistry.cs +++ b/scripts/systems/GameRegistry.cs @@ -7,7 +7,7 @@ public partial class GameRegistry : Node private const string PLANT_RESOURCE_PATH = "res://assets/plants/"; private const string ZOMBIE_RESOURCE_PATH = "res://assets/zombies/"; public static GameRegistry Instance { get; private set; } - public static readonly Dictionary EntityDictionary = []; + public static readonly Dictionary EntityDictionary = []; public override void _EnterTree() { @@ -37,7 +37,7 @@ public partial class GameRegistry : Node } } - public static DisplayResource GetEntityByName(string name) + public static EntityResource GetEntityByName(string name) { if (EntityDictionary.ContainsKey(name) == false) return null; return EntityDictionary[name]; @@ -51,9 +51,9 @@ public partial class GameRegistry : Node } return result; } - public static List GetEntities() + public static List GetEntities() { - List result = []; + List result = []; foreach (var value in EntityDictionary.Values) { result.Add(value);