diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2013-06-24 21:37:15 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2013-06-24 21:37:15 +0200 |
commit | 7c2e955e1552a9c4e412ea2c936be61fc78ba010 (patch) | |
tree | ee506dfbec54f998d10c385bde3a1c3fa04e66b2 /src/object/objman.h | |
parent | e218dcfdf2c58f8841e7ebd220527d08e870a6d5 (diff) | |
parent | b376486fd74fa02b0297ceef6d0f977b32358e5e (diff) | |
download | colobot-7c2e955e1552a9c4e412ea2c936be61fc78ba010.tar.gz colobot-7c2e955e1552a9c4e412ea2c936be61fc78ba010.tar.bz2 colobot-7c2e955e1552a9c4e412ea2c936be61fc78ba010.zip |
Colobot Gold 0.1.0-alpha
Diffstat (limited to 'src/object/objman.h')
-rw-r--r-- | src/object/objman.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/object/objman.h b/src/object/objman.h new file mode 100644 index 0000000..3087383 --- /dev/null +++ b/src/object/objman.h @@ -0,0 +1,53 @@ +// * This file is part of the COLOBOT source code +// * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch +// * +// * 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://www.gnu.org/licenses/. + +/** + * \file object/objman.h + * \brief Instance manager for objects + */ + +#pragma once + +#include "object/object.h" + +#include "common/singleton.h" + +const int MAX_OBJECTS = 500; + +/** + * \class ObjectManager + * \brief Manager for objects + */ +class CObjectManager : public CSingleton<CObjectManager> +{ +public: + CObjectManager(); + virtual ~CObjectManager(); + + //! Registers new object + bool AddInstance(CObject* instance); + //! Deletes the registered object + bool DeleteInstance(CObject* instance); + //! Seeks for an object + CObject* SearchInstance(int id); + //! Creates an object + CObject* CreateObject(Math::Vector pos, float angle, float zoom, float height, ObjectType type, float power, bool trainer, bool toy, int option); + +protected: + CObject* m_table[MAX_OBJECTS]; + int usedCount; +}; + |