-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
33 lines (28 loc) · 915 Bytes
/
Program.cs
File metadata and controls
33 lines (28 loc) · 915 Bytes
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
using Battle.Models;
namespace Battle
{
public class Program
{
private static void Main(string[] args)
{
// Create Fighter (instantiate object)
// Equip Armor (assign values)
// Equip Weapon (assign values)
ICombatant fighter = new Fighter();
fighter.Armor.Defense = 10;
fighter.Weapon.Power = 10;
ICombatant horse = new Mount();
horse.Armor.Defense = 5;
horse.Weapon.Power = 0;
// Create Enemy (instantiate object)
// Equip Armor (assign values)
// Equip Weapon (assign values)
ICombatant enemy = new Enemy();
enemy.Armor.Defense = 8;
enemy.Weapon.Power = 10;
// Attack Enemy (execute method)
fighter.Attack(enemy);
horse.Attack(enemy);
}
}
}