diff --git a/source/glest_game/types/tileset_model_type.cpp b/source/glest_game/types/tileset_model_type.cpp new file mode 100644 index 00000000..8b259fb7 --- /dev/null +++ b/source/glest_game/types/tileset_model_type.cpp @@ -0,0 +1,35 @@ +// ============================================================== +// This file is part of Glest (www.glest.org) +// +// Copyright (C) 2001-2008 Marti�o Figueroa +// +// You can redistribute this code and/or modify it under +// the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version +// ============================================================== + +#include "tileset_model_type.h" +#include "leak_dumper.h" + +namespace Glest{ namespace Game{ + +// ===================================================== +// class TilesetModelType +// ===================================================== + +TilesetModelType::~TilesetModelType(){ + while(!(particleTypes.empty())){ + delete particleTypes.back(); + particleTypes.pop_back(); + } + //Logger::getInstance().add("ObjectType", true); +} + + +void TilesetModelType::addParticleSystem(ObjectParticleSystemType *particleSystem){ + particleTypes.push_back(particleSystem); +} + + +}}//end namespace diff --git a/source/glest_game/types/tileset_model_type.h b/source/glest_game/types/tileset_model_type.h new file mode 100644 index 00000000..1805170c --- /dev/null +++ b/source/glest_game/types/tileset_model_type.h @@ -0,0 +1,62 @@ +// ============================================================== +// This file is part of Glest (www.glest.org) +// +// Copyright (C) 2001-2008 Martio Figueroa +// +// You can redistribute this code and/or modify it under +// the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version +// ============================================================== +#ifndef _GLEST_GAME_TILESET_MODEL_TYPE_H_ +#define _GLEST_GAME_TILESET_MODEL_TYPE_H_ + +#include + +#include "model.h" +#include "vec.h" +#include "leak_dumper.h" +#include "unit_particle_type.h" + +using std::vector; + +namespace Glest{ namespace Game{ + +using Shared::Graphics::Model; +using Shared::Graphics::Vec3f; + +// ===================================================== +// class ObjectType +// +/// Each of the possible objects of the map: trees, stones ... +// ===================================================== + +typedef vector ModelParticleSystemTypes; + +class TilesetModelType{ +private: + Model *model; + ModelParticleSystemTypes particleTypes; + int height; + bool rotationAllowed; + +public: + ~TilesetModelType(); + + void addParticleSystem(ObjectParticleSystemType *particleSystem); + bool hasParticles() const {return !particleTypes.empty();} + ModelParticleSystemTypes* getParticleTypes() { return &particleTypes ;} + + + Model * getModel() const {return model;} + void setModel(Model *model) {this->model=model;} + + int getHeight() const {return height;} + void setHeight(int height) {this->height=height;} + bool getRotationAllowed() const {return rotationAllowed;} + void setRotationAllowed(int rotationAllowed) {this->rotationAllowed=rotationAllowed;} +}; + +}}//end namespace + +#endif