complete refactor
This commit is contained in:
parent
65fe0e5c5d
commit
de2e8b1e50
71 changed files with 212 additions and 137 deletions
16
scripts/resources/entities/EntityResource.cs
Normal file
16
scripts/resources/entities/EntityResource.cs
Normal 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;
|
||||
}
|
||||
1
scripts/resources/entities/EntityResource.cs.uid
Normal file
1
scripts/resources/entities/EntityResource.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://j7wr5mj7j81b
|
||||
11
scripts/resources/entities/GridEntityResource.cs
Normal file
11
scripts/resources/entities/GridEntityResource.cs
Normal 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;
|
||||
}
|
||||
1
scripts/resources/entities/GridEntityResource.cs.uid
Normal file
1
scripts/resources/entities/GridEntityResource.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bwjyra0xvhde5
|
||||
9
scripts/resources/entities/PlantResource.cs
Normal file
9
scripts/resources/entities/PlantResource.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
using Godot;
|
||||
|
||||
namespace Newlon.Resources;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class PlantResource : GridEntityResource
|
||||
{
|
||||
}
|
||||
1
scripts/resources/entities/PlantResource.cs.uid
Normal file
1
scripts/resources/entities/PlantResource.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cyenlko1knygw
|
||||
28
scripts/resources/entities/ZombieResource.cs
Normal file
28
scripts/resources/entities/ZombieResource.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
1
scripts/resources/entities/ZombieResource.cs.uid
Normal file
1
scripts/resources/entities/ZombieResource.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cqxj7o8hdm82n
|
||||
Loading…
Add table
Add a link
Reference in a new issue