aboutsummaryrefslogtreecommitdiff
path: root/backend/ObjectFactory.cpp
blob: 4a0642bc9e9dfacecc59c6a7c467c7ea9528d548 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "ObjectFactory.h"

#include "ArmorObject.h"
#include "ConsumableObject.h"
#include "GoldObject.h"
#include "WeaponObject.h"

Object * ObjectFactory::create_object(ObjectType type, const char * name, const char * description) {
	switch (type) {
		case ARMOR: return new ArmorObject(name, description);
		case CONSUMABLE: return new ConsumableObject(name, description);
		case GOLD: return new GoldObject(name, description);
		case WEAPON: return new WeaponObject(name, description);
	}
	return ObjectFactory::create_object(name, description);
}

Object * ObjectFactory::create_object(const char * name, const char * description) {
	return new Object(name, description);
}