-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDamageSpellBook.cpp
42 lines (35 loc) · 1000 Bytes
/
DamageSpellBook.cpp
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
//
// Created by Alex on 09.09.18.
//
#include "DamageSpellBook.h"
DamageSpellBook::DamageSpellBook()
{
waterVortex = new WaterVortex();
fire_ring = new Fire_Ring();
frantic_cold = new Frantic_Cold();
pillarOfFire = new PillarOfFire();
ligthning_triedent = new Ligthning_Triedent();
spellMap.emplace(WATER_VORTEX, waterVortex);
spellMap.emplace(FIRE_RING, fire_ring);
spellMap.emplace(FRANTIC_COLD, frantic_cold);
spellMap.emplace(PIILLAR_OF_FIRE, pillarOfFire);
spellMap.emplace(LIGTHNING_TRIDENT, ligthning_triedent);
}
DamageSpellBook::~DamageSpellBook()
{
delete waterVortex;
delete fire_ring;
delete frantic_cold;
delete pillarOfFire;
delete ligthning_triedent;
}
int DamageSpellBook::getNeedMana(DamageSpellList spell)
{
auto it = spellMap.find(spell);
return it->second->getNeedMana();
}
int DamageSpellBook::getDamage(DamageSpellList spell)
{
auto it = spellMap.find(spell);
return it->second->getDamage();
}