add unity project
add SOLID examples
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace DefaultNamespace.Solid
|
||||
{
|
||||
public interface IDamageable
|
||||
{
|
||||
void TakeDamage(float damage);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5914f06c3394359bc5943113e36c8c0
|
||||
timeCreated: 1742921379
|
||||
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace.Solid
|
||||
{
|
||||
public interface IEffectTrigger
|
||||
{
|
||||
void ApplyEffect();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40fc6b97c8a64f359e5eb024c96a166e
|
||||
timeCreated: 1742921330
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace DefaultNamespace.Solid
|
||||
{
|
||||
public interface IExplodable
|
||||
{
|
||||
void Explode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6dd9e4f0b84148589e7e20e8e1cef27d
|
||||
timeCreated: 1742921363
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace DefaultNamespace.Solid
|
||||
{
|
||||
public interface IHealth
|
||||
{
|
||||
void Heal(float healAmount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 791cec6c848c4d7d9ec0f0e498389bb0
|
||||
timeCreated: 1742921404
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace DefaultNamespace.Solid
|
||||
{
|
||||
public interface IShooter
|
||||
{
|
||||
void Fire();
|
||||
|
||||
// BAD IDEA - segregate interfaces
|
||||
// void ApplyEffect();
|
||||
// void Explode();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc6f6606157e44a4b77936fc2e025899
|
||||
timeCreated: 1742920554
|
||||
Reference in New Issue
Block a user