Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 14 / Farm / Factory / Factory.cpp
blob: d7d6ec586fbd245012582bf80f949b0dd8241aab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "Factory.h"


Animal* AnimalFactory::createAnimal(Animal::AnimalType type)
{
	switch (type)
	{
		case Animal::AnimalType::Cat: return new Cat();
		case Animal::AnimalType::Dog: return new Dog();
		case Animal::AnimalType::Mouse: return new Mouse();
	}
	return nullptr;
}