complete refactor
This commit is contained in:
parent
65fe0e5c5d
commit
de2e8b1e50
71 changed files with 212 additions and 137 deletions
|
|
@ -1,22 +0,0 @@
|
|||
using Godot;
|
||||
|
||||
[Tool]
|
||||
public partial class EntityResource : Resource
|
||||
{
|
||||
[Export] public string name_key;
|
||||
[Export] public string description_key;
|
||||
[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 Layer = 1;
|
||||
[Export] public int Order = 0;
|
||||
public string internal_id;
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
using Godot;
|
||||
|
||||
namespace Newlon.Resources;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class MoneyReward : RewardResource
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
using Godot;
|
||||
|
||||
namespace Newlon;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class PlantResource : EntityResource
|
||||
{
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
using Godot;
|
||||
using Newlon;
|
||||
|
||||
namespace Newlon.Resources;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
using Godot;
|
||||
|
||||
namespace Newlon.Resources;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public abstract partial class RewardResource : Resource
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
using Godot;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class ZombieResource : EntityResource
|
||||
{
|
||||
}
|
||||
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;
|
||||
}
|
||||
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
|
||||
{
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue