Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Coding.Exercise
  4. {
  5.     abstract class AOESpell
  6.     {
  7.         public int Health { get; private set; }
  8.         public void ApplyDamage(int damage)
  9.         {
  10.             Health -= GetDamage(Unit);
  11.         }
  12.         public abstract float GetDamage(Unit unit);
  13.     }
  14.    
  15.     public class CustomSpell : AOESpell
  16.     {
  17.         public override void GetDamage(Unit unit)
  18.         {
  19.             Unit units = new unit[];
  20.             foreach(Unit unit in units)
  21.             {
  22.                 Health -= Health / 2;
  23.             }
  24.         }
  25.     }
  26.    
  27.     public class Unit
  28.     {
  29.         int Health;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement