2015-06-20 17:27:43 +00:00
|
|
|
|
/*
|
|
|
|
|
* This file is part of the Colobot: Gold Edition source code
|
|
|
|
|
* Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
|
|
|
|
|
* http://epsiteс.ch; http://colobot.info; http://github.com/colobot
|
|
|
|
|
*
|
|
|
|
|
* This program 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.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see http://gnu.org/licenses
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \file object/object_factory.h
|
|
|
|
|
* \brief CObjectFactory - factory for game objects
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "math/vector.h"
|
|
|
|
|
|
|
|
|
|
#include "object/object_type.h"
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
2015-08-02 09:40:47 +00:00
|
|
|
|
namespace Gfx
|
|
|
|
|
{
|
2015-06-20 17:27:43 +00:00
|
|
|
|
class CEngine;
|
2015-07-09 16:45:02 +00:00
|
|
|
|
class COldModelManager;
|
2015-07-11 17:48:37 +00:00
|
|
|
|
class CModelManager;
|
2015-06-20 17:27:43 +00:00
|
|
|
|
class CParticle;
|
|
|
|
|
class CTerrain;
|
|
|
|
|
} // namespace Gfx
|
|
|
|
|
|
|
|
|
|
class CObject;
|
2015-07-02 21:48:30 +00:00
|
|
|
|
class COldObject;
|
2015-06-27 21:22:55 +00:00
|
|
|
|
struct ObjectCreateParams;
|
2015-06-20 17:27:43 +00:00
|
|
|
|
|
2015-06-21 09:16:09 +00:00
|
|
|
|
using CObjectUPtr = std::unique_ptr<CObject>;
|
|
|
|
|
|
2015-06-20 17:27:43 +00:00
|
|
|
|
class CObjectFactory
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CObjectFactory(Gfx::CEngine* engine,
|
|
|
|
|
Gfx::CTerrain* terrain,
|
2015-07-11 17:48:37 +00:00
|
|
|
|
Gfx::COldModelManager* oldModelManager,
|
|
|
|
|
Gfx::CModelManager* modelManager,
|
2015-07-10 17:53:32 +00:00
|
|
|
|
Gfx::CParticle* particle);
|
2015-06-20 17:27:43 +00:00
|
|
|
|
|
2015-06-21 09:16:09 +00:00
|
|
|
|
CObjectUPtr CreateObject(const ObjectCreateParams& params);
|
2015-06-20 17:27:43 +00:00
|
|
|
|
|
|
|
|
|
private:
|
2015-06-21 09:16:09 +00:00
|
|
|
|
CObjectUPtr CreateBuilding(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateResource(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateVehicle(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateInsect(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateFlag(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateBarrier(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreatePlant(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateMushroom(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateQuartz(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateRoot(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateHome(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateRuin(const ObjectCreateParams& params);
|
|
|
|
|
CObjectUPtr CreateApollo(const ObjectCreateParams& params);
|
2015-07-02 21:48:30 +00:00
|
|
|
|
void AddObjectAuto(COldObject* obj);
|
2015-06-20 17:27:43 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Gfx::CEngine* m_engine;
|
|
|
|
|
Gfx::CTerrain* m_terrain;
|
2015-07-11 17:48:37 +00:00
|
|
|
|
Gfx::COldModelManager* m_oldModelManager;
|
|
|
|
|
Gfx::CModelManager* m_modelManager;
|
2015-06-20 17:27:43 +00:00
|
|
|
|
Gfx::CParticle* m_particle;
|
|
|
|
|
};
|