complete refactor

This commit is contained in:
Rendo 2025-07-25 18:48:49 +05:00
commit de2e8b1e50
71 changed files with 212 additions and 137 deletions

View file

@ -0,0 +1,16 @@
using Godot;
[Tool]
public partial class EntityResource : Resource
{
[Export] public string NameKey;
[Export] public string DescriptionKey;
[Export] public float Cost;
[Export] public PackedScene Scene;
[Export] public float ReloadTime;
[Export(PropertyHint.Range, "0,1,0.01")] public float ReloadProgress;
[Export] public Texture2D Preview;
[Export] public CustomSeedpacketFrame CustomFrame;
[Export] public int Order = 0;
public string internal_id;
}

View file

@ -0,0 +1 @@
uid://j7wr5mj7j81b

View file

@ -0,0 +1,11 @@
using Godot;
namespace Newlon.Resources;
[GlobalClass]
[Tool]
public partial class GridEntityResource : EntityResource
{
[Export] public int Layer = 1;
[Export] public bool DontRegister = false;
}

View file

@ -0,0 +1 @@
uid://bwjyra0xvhde5

View file

@ -0,0 +1,9 @@
using Godot;
namespace Newlon.Resources;
[GlobalClass]
[Tool]
public partial class PlantResource : GridEntityResource
{
}

View file

@ -0,0 +1 @@
uid://cyenlko1knygw

View file

@ -0,0 +1,28 @@
using Godot;
namespace Newlon.Resources;
[GlobalClass]
[Tool]
public partial class ZombieResource : EntityResource
{
public GridEntityResource ToGridEntity()
{
GridEntityResource result = new();
result.NameKey = NameKey;
result.DescriptionKey = DescriptionKey;
result.Cost = Cost;
result.Scene = Scene;
result.ReloadTime = ReloadTime;
result.ReloadProgress = ReloadProgress;
result.Preview = Preview;
result.CustomFrame = CustomFrame;
result.Order = Order;
result.Layer = 1;
result.DontRegister = true;
return result;
}
}

View file

@ -0,0 +1 @@
uid://cqxj7o8hdm82n