Colobot
object_factory.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsitec.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
25 #pragma once
26 
27 #include "math/vector.h"
28 
29 #include "object/object_type.h"
30 
31 #include <memory>
32 
33 namespace Gfx
34 {
35 class CEngine;
36 class COldModelManager;
37 class CModelManager;
38 class CParticle;
39 class CTerrain;
40 } // namespace Gfx
41 
42 class CObject;
43 class COldObject;
44 struct ObjectCreateParams;
45 
46 using CObjectUPtr = std::unique_ptr<CObject>;
47 
49 {
50 public:
52  Gfx::CTerrain* terrain,
53  Gfx::COldModelManager* oldModelManager,
54  Gfx::CModelManager* modelManager,
55  Gfx::CParticle* particle);
56 
57  CObjectUPtr CreateObject(const ObjectCreateParams& params);
58 
59 private:
60  CObjectUPtr CreateResource(const ObjectCreateParams& params);
61  CObjectUPtr CreateFlag(const ObjectCreateParams& params);
62  CObjectUPtr CreateBarrier(const ObjectCreateParams& params);
63  CObjectUPtr CreatePlant(const ObjectCreateParams& params);
64  CObjectUPtr CreateMushroom(const ObjectCreateParams& params);
65  CObjectUPtr CreateTeen(const ObjectCreateParams& params);
66  CObjectUPtr CreateQuartz(const ObjectCreateParams& params);
67  CObjectUPtr CreateRoot(const ObjectCreateParams& params);
68  CObjectUPtr CreateHome(const ObjectCreateParams& params);
69  CObjectUPtr CreateRuin(const ObjectCreateParams& params);
70  CObjectUPtr CreateApollo(const ObjectCreateParams& params);
71  void AddObjectAuto(COldObject* obj);
72 
73 private:
74  Gfx::CEngine* m_engine;
75  Gfx::CTerrain* m_terrain;
76  Gfx::COldModelManager* m_oldModelManager;
77  Gfx::CModelManager* m_modelManager;
78  Gfx::CParticle* m_particle;
79 };
Manager for static models.
Definition: oldmodelmanager.h:54
Definition: old_object.h:79
ObjectType enum.
Particle engine.
Definition: particle.h:223
Terrain loader/generator and manager.
Definition: terrain.h:147
Namespace for (new) graphics code.
Definition: app.h:49
Vector struct and related functions.
Manager for models read from model files.
Definition: model_manager.h:34
The graphics engine.
Definition: engine.h:585
Definition: object_create_params.h:26
Definition: object_factory.h:48
Base class for all 3D in-game objects.
Definition: object.h:63