Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Coding.Exercise
- {
- abstract class AOESpell
- {
- public int Health { get; private set; }
- public void ApplyDamage(int damage)
- {
- Health -= GetDamage(Unit);
- }
- public abstract float GetDamage(Unit unit);
- }
- public class CustomSpell : AOESpell
- {
- public override void GetDamage(Unit unit)
- {
- Unit units = new unit[];
- foreach(Unit unit in units)
- {
- Health -= Health / 2;
- }
- }
- }
- public class Unit
- {
- int Health;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement