-
Notifications
You must be signed in to change notification settings - Fork 0
/
CharacterStats.cs
57 lines (52 loc) · 1.62 KB
/
CharacterStats.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
using Mogre;
using Mogre.TutorialFramework;
using System;
namespace RaceGame
{
/// <summary>
/// This abstract method set some basic statistics for a character in the game
/// </summary>
abstract class CharacterStats
{
/// <summary>
/// Constructor
/// </summary>
public CharacterStats()
{
InitStats();
}
protected Stat health; // This field represents the health of the character
/// <summary>
/// Read only. This property gives back the health stat of the character.
/// </summary>
public Stat Health
{
get { return health; }
}
protected Stat shield; // This field represents the shield of the character
/// <summary>
/// Read only. This property gives back the shield stat of the character.
/// </summary>
public Stat Shield
{
get { return shield; }
}
protected Stat lives; // This field represents the lives stat of the character
/// <summary>
/// Read only. This property gives back the lives stat of the character.
/// </summary>
public Stat Lives
{
get { return lives; }
}
/// <summary>
/// This method initializes the stats objects, initial values are to be set in derived classes
/// </summary>
virtual protected void InitStats()
{
lives = new Stat();
health = new Stat();
shield = new Stat();
}
}
}