Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface IMoneyGiver
- {
- void GiveMoney();
- }
- public interface IDamageDealer
- {
- void DealDamage();
- }
- public interface IEntity : IMoneyGiver, IDamageDealer
- {
- }
- public class Entity : IEntity
- {
- private IMoneyGiver _moneyGiver = new DefaultMoneyGiver();
- private IDamageDealer _damageDealer = new DefaultDamageDealer();
- public void GiveMoney()
- {
- _moneyGiver.GiveMoney();
- }
- public void DealDamage()
- {
- _damageDealer.DealDamage();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement