-
Notifications
You must be signed in to change notification settings - Fork 0
/
Potions.cs
52 lines (40 loc) · 1.66 KB
/
Potions.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
using PotionDeliveryService.Interfaces;
namespace PotionDeliveryService;
public class Potion : IPotion
{
public Potion(string name, IIngredient ingredient1, IIngredient ingredient2, IEffect effect, PotionColor color)
{
this.Name = name;
this.Ingredient1 = ingredient1;
this.Ingredient2 = ingredient2;
this.Effect = effect;
this.Color = color;
}
/// <summary>
/// Initializes a new instance of the <see cref="Potion"/> class.
/// Constructor for building a Potion where the name is the color + Potion.
/// </summary>
/// <param name="color"></param>
/// <param name="ingredient1"></param>
/// <param name="ingredient2"></param>
/// <param name="effect"></param>
public Potion(PotionColor color, IIngredient ingredient1, IIngredient ingredient2, IEffect effect)
: this($"{color}Potion", ingredient1, ingredient2, effect, color)
{
}
public string Name { get; }
public IIngredient Ingredient1 { get; }
public IIngredient Ingredient2 { get; }
public IEffect Effect { get; }
public PotionColor Color { get; }
public double Price { get; set; }
}
public static class Potions
{
public static IPotion HealthPotion =>
new Potion("Health Potion", Ingredients.Water, Ingredients.RedBerry, Effects.HealingEffect, PotionColor.Red);
public static IPotion ManaPotion =>
new Potion("Mana Potion", Ingredients.Water, Ingredients.GlowingMushroom, Effects.ManaRestoreEffect, PotionColor.Blue);
public static IPotion RecoveryPotion =>
new Potion("Recovery Potion", HealthPotion, ManaPotion, Effects.ManaAndHealthRestoreEffect, PotionColor.Purple);
}