/** * File: GenFactory.cc * Copyright (C) 2025 Tyler Triplett * License: GNU GPL 3.0 or later <https://www.gnu.org/licenses/gpl-3.0.html> * * This is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <generators/GenFactory.hh> #include <generators/FracBase.hh> #include <generators/JuliaBase.hh> #include <generators/MandelbrotGen.hh> #include <generators/ShipGen.hh> #include <generators/NoiseGen.hh> namespace ty { GenFactory::GenFactory() { addGen<MandelbrotGen<FracBase>>("mandelbrot"); addGen<MandelbrotGen<JuliaBase>>("mandelbrotJulia"); addGen<ShipGen<FracBase>>("burningship"); addGen<ShipGen<JuliaBase>>("burningshipJulia"); addGen<NoiseGen>("noise"); } GenFactory::~GenFactory() { } std::shared_ptr<BaseGen> GenFactory::create(const std::string& type, const int& w, const int& h) const { const auto it = genMap_.find(type); return it != genMap_.end() ? (it->second)(w, h) : nullptr; } } /// ty