From 90301e24c0fc5fcd6bffb0399e203e5adea6aa2c Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sun, 31 Mar 2013 10:21:22 +0200 Subject: Added field "item" to class "object" in CBot --- src/object/objman.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/object/objman.h (limited to 'src/object/objman.h') diff --git a/src/object/objman.h b/src/object/objman.h new file mode 100644 index 0000000..3bdf1a2 --- /dev/null +++ b/src/object/objman.h @@ -0,0 +1,54 @@ +// * 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 common/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 +{ +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; +}; + + -- cgit v1.2.3-1-g7c22 From c1db140ad36402271914be8d993413aa5f4676bc Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 2 May 2013 10:44:07 +0200 Subject: Updated Main Mnu music For now only code - we need to wait for PiXeL to give us new music :) --- src/object/objman.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/object/objman.h') diff --git a/src/object/objman.h b/src/object/objman.h index 3bdf1a2..c776a86 100644 --- a/src/object/objman.h +++ b/src/object/objman.h @@ -15,7 +15,7 @@ // * along with this program. If not, see http://www.gnu.org/licenses/. /** - * \file common/objman.h + * \file object/objman.h * \brief Instance manager for objects */ -- cgit v1.2.3-1-g7c22 From 8765d58b02c9afd00186bae4a0045dff32f7d102 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 26 May 2013 17:47:54 +0200 Subject: Fixed code formatting * moved braces to new lines * fixed some function/variable names * fixed whitespace issues --- src/object/objman.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/object/objman.h') diff --git a/src/object/objman.h b/src/object/objman.h index c776a86..3087383 100644 --- a/src/object/objman.h +++ b/src/object/objman.h @@ -51,4 +51,3 @@ protected: int usedCount; }; - -- cgit v1.2.3-1-g7c22