/BJEngine/src/Core.cpp
https://bitbucket.org/mild1/bj · C++ · 45 lines · 34 code · 8 blank · 3 comment · 0 complexity · be1c898542c2869ea35ad28ea15b4bb4 MD5 · raw file
- #include "Core.h"
- #include "InfiniteDeck.h"
- #include "StrategyCalculator.h"
-
- IDeck& Core::GetDeck()
- {
- return *deck_;
- }
-
- IStrategyCalculatorPtr Core::NewStrategyCalculator()
- {
- Rules rules;
- return IStrategyCalculatorPtr (new StrategyCalculator(rules));
- }
-
- std::ofstream& Core::GetLog()
- {
- return log_;
- }
-
- Core& Core::GetCore()
- {
- //no need in
- //static Core* core = new Core();
- //things aren't that complex yet
- static Core core;
- return core;
- }
-
- Core::Core(const Core& core){}
-
- Core::~Core()
- {
- delete deck_;
-
- log_.flush();
- log_.close();
- }
-
- Core::Core():
- deck_(new InfiniteDeck())
- , log_("bjengine.log", std::ios::out)
- {
- log_ << "Core was successfully created" << std::endl;
- }