broken composition and signals
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
namespace Movementtests.interfaces;
|
||||
|
||||
public interface IDamageable
|
||||
{
|
||||
void TakeDamage(RDamage damage);
|
||||
event Action<float> DamageTaken;
|
||||
float TakeDamage(RDamage damage);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
namespace Movementtests.interfaces;
|
||||
|
||||
public interface IKillable
|
||||
public interface IHealthable
|
||||
{
|
||||
float CurrentHealth { get; set; }
|
||||
void ReduceHealth(float amount);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
namespace Movementtests.interfaces;
|
||||
|
||||
public interface IHealthable
|
||||
public interface IKillable
|
||||
{
|
||||
float CurrentHealth { get; set; }
|
||||
void ReduceHealth(float amount);
|
||||
void Kill();
|
||||
}
|
||||
1
interfaces/IKillable.cs.uid
Normal file
1
interfaces/IKillable.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dqpjr2d01sk1a
|
||||
@@ -9,4 +9,8 @@ public static class NodeExtensions
|
||||
{
|
||||
return nodes == null ? System.Array.Empty<IDamageable>() : nodes.OfType<IDamageable>().ToArray();
|
||||
}
|
||||
public static IKillable[] ToIKillables(this GodotObject[] nodes)
|
||||
{
|
||||
return nodes == null ? System.Array.Empty<IKillable>() : nodes.OfType<IKillable>().ToArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user