-
Notifications
You must be signed in to change notification settings - Fork 0
/
MakeItem.cc
31 lines (27 loc) · 914 Bytes
/
MakeItem.cc
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
//
// MakeItem.cpp
// test
//
// Created by Wang Annan on 2016-11-27.
// Copyright © 2016 Wang Annan. All rights reserved.
//
#include "MakeItem.h"
using namespace std;
Potion * MakeItem:: CreatePotion(const int &num_translate) {
Potion *p = nullptr;
if (num_translate == 0) {p = new RH(); }
else if (num_translate == 1) {p = new BA(); }
else if (num_translate == 2) {p = new BD(); }
else if (num_translate == 3) {p = new PH(); }
else if (num_translate == 4) {p = new WA(); }
else if (num_translate == 5) {p = new WD(); }
return p;
}
Treasure * MakeItem::CreateTreasure(const int &num_translate) {
Treasure *t = nullptr;
if (num_translate == 6) {t = new NormalHoard(); }
else if (num_translate == 7) {t = new SmallHoard(); }
else if (num_translate == 8) {t = new MerchantHoard(); }
else if (num_translate == 9) {t = new DragonHoard(); }
return t;
}