mirror of
https://github.com/Relintai/mourne_rcpp_fw.git
synced 2024-11-13 05:57:21 +01:00
37 lines
748 B
C++
37 lines
748 B
C++
|
#include "weather_initializer.h"
|
||
|
|
||
|
void WeatherInitializer::allocate_controller() {
|
||
|
ERR_FAIL_COND(_controller);
|
||
|
|
||
|
_controller = new WeatherController();
|
||
|
}
|
||
|
void WeatherInitializer::free_controller() {
|
||
|
if (_controller) {
|
||
|
delete _controller;
|
||
|
_controller = nullptr;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void WeatherInitializer::allocate_model() {
|
||
|
ERR_FAIL_COND(_model);
|
||
|
|
||
|
_model = new WeatherModel();
|
||
|
}
|
||
|
void WeatherInitializer::free_model() {
|
||
|
if (_model) {
|
||
|
delete _model;
|
||
|
_model = nullptr;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void WeatherInitializer::allocate_all() {
|
||
|
allocate_model();
|
||
|
allocate_controller();
|
||
|
}
|
||
|
void WeatherInitializer::free_all() {
|
||
|
free_controller();
|
||
|
free_model();
|
||
|
}
|
||
|
|
||
|
WeatherController *WeatherInitializer::_controller = nullptr;
|
||
|
WeatherModel *WeatherInitializer::_model = nullptr;
|