-
Notifications
You must be signed in to change notification settings - Fork 2
/
Ability.cs
66 lines (52 loc) · 1.38 KB
/
Ability.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
namespace OOP_Teamwork___Game
{
using System;
public class Ability
{
// Not finished, must add passive effect changers and some methods for that
#region Fields
private readonly int requiredLevel;
private readonly AbilityType abilityType;
private int damage;
private int abilityLevel = 1;
#endregion
#region Constructors
public Ability(int damage, int requiredLevel, AbilityType abilityType)
{
this.Damage = damage;
this.requiredLevel = requiredLevel;
this.abilityType = abilityType;
}
#endregion
#region Properties
public int Damage
{
get
{
return this.damage;
}
set
{
if (value <= 0)
{
throw new ArgumentException("Damage must be more than 0.");
}
this.damage = value;
}
}
public int AbilityLevel
{
get { return this.abilityLevel; }
set { this.abilityLevel = value; }
}
public int RequiredLevel
{
get { return this.requiredLevel; }
}
public AbilityType AbilityType
{
get { return this.abilityType; }
}
#endregion
}
}