-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathItemFactory.cpp
56 lines (49 loc) · 1.05 KB
/
ItemFactory.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#ifndef WORLDSIM_ITEM_FACTORY_CPP
#define WORLDSIM_ITEM_FACTORY_CPP
/* Worldsim: ItemFactory.cpp
#include"ItemFactory.cpp"
*/
#include "ItemFactory.hpp"
ItemFactory::ItemFactory()
{
}
// Produce the item with stats relevant based on character skill, location, and tools used.
Item* ItemFactory::produce(ItemType type, Character* character, Location* location /* TOOL */)
{
return nullptr;
}
// Produce worst guaranteed item with the given factors
Item* ItemFactory::produceBasic(ItemType type, Character* character, Location* location /* TOOL */)
{
if ( type == ITEM_HOE )
{
return new Item_Hoe();
}
else if (type == ITEM_SWORD )
{
return new Item_Sword();
}
else if (type == ITEM_KNIFE )
{
return new Item_Knife();
}
else if (type == ITEM_LONGBOW )
{
return new Item_Longbow();
}
else if (type == ITEM_SPEAR )
{
return new Item_Spear();
}
else if (type == ITEM_PICKAXE )
{
return new Item_Pickaxe();
}
else if (type == ITEM_AXE )
{
return new Item_Axe();
}
return nullptr;
}
#endif // WORLDSIM_ITEM_FACTORY_CPP