Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

ExManagerLight.cpp

Go to the documentation of this file.
00001 /*
00002  * ExNihilo 3D Engine
00003  * 
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  *
00018  * Please read AUTHORS file !!!
00019  * 
00020  * $Id: ExManagerLight.cpp,v 1.5 2002/08/01 01:18:22 data Exp $
00021  *
00022  */
00023 
00024 #include "ExManagerLight.h"
00025 
00026 ExManagerLight::ExManagerLight(void)
00027 {
00028 Guard(ExManagerLight::ExManagerLight(void))
00029 UnGuard
00030 }
00031 
00032 
00033 ExManagerLight::~ExManagerLight(void)
00034 {
00035 Guard(ExManagerLight::~ExManagerLight(void))
00036 UnGuard
00037 }
00038 
00039 
00040 void  ExManagerLight::Reset(void)
00041 {
00042 Guard(void  ExManagerLight::Reset(void))
00043         m_VecLight.clear();
00044 UnGuard
00045 }
00046 
00047 
00048 void  ExManagerLight::Init(void)
00049 {
00050 Guard(void  ExManagerLight::Init(void))
00051 UnGuard
00052 }
00053 
00054 
00055 bool  ExManagerLight::Init(char * FileName)
00056 {
00057 Guard(bool  ExManagerLight::Init(char * FileName))
00058         //openf file and load object
00059         return true;
00060 UnGuard
00061 }
00062 
00063 
00064 ExId  ExManagerLight::NewObject(void)
00065 {
00066 Guard(ExId  ExManagerLight::NewObject(void))
00067         ExCLight NewLight;
00068         m_VecLight.push_back(NewLight);
00069         return NewLight.GetId();
00070 UnGuard
00071 }
00072 
00073 
00074 ExCLight *  ExManagerLight::Get(char * Name)
00075 {
00076 Guard(ExCLight * ExManagerLight::Get(char * Name))
00077         int i=0;
00078         for(m_ItVecLight=m_VecLight.begin();m_ItVecLight!=m_VecLight.end();m_ItVecLight++,i++)
00079         {
00080                 if(strcmp(m_ItVecLight->GetName(),Name)==0)
00081                 {
00082                         return &m_VecLight.at(i);
00083                 }
00084         }
00085         return NULL;
00086 UnGuard
00087 }
00088 
00089 
00090 ExCLight * ExManagerLight::Get(ExId Id)
00091 {
00092 Guard(ExCLight * ExManagerLight::Get(ExId Id))
00093         int i=0;
00094         for(m_ItVecLight=m_VecLight.begin();m_ItVecLight!=m_VecLight.end();m_ItVecLight++,i++)
00095         {
00096                 if(m_ItVecLight->GetId()==Id)
00097                 {
00098                         return &m_VecLight.at(i);
00099                 }
00100         }
00101         return NULL;    
00102 UnGuard
00103 }
00104 
00105 
00106 ExId  ExManagerLight::Add(ExCLight Object)
00107 {
00108 Guard(ExId ExManagerLight::Add(ExCLight Object))
00109         m_VecLight.push_back(Object);
00110         return Object.GetId();
00111 UnGuard
00112 }
00113 
00114 
00115 bool  ExManagerLight::Remove(ExId Id)
00116 {
00117 Guard(bool ExManagerLight::Remove(ExId Id))
00118         for(m_ItVecLight=m_VecLight.begin();m_ItVecLight!=m_VecLight.end();m_ItVecLight++)
00119         {
00120                 if(m_ItVecLight->GetId()==Id)
00121                 {
00122                         m_VecLight.erase(m_ItVecLight);
00123                         return true;
00124                 }
00125         }
00126         return false;
00127 UnGuard
00128 }
00129 
00130 
00131 ExId  ExManagerLight::GetIdByName(char *Name)
00132 {
00133 Guard(ExId ExManagerLight::GetIdByName(char *Name))
00134         for(m_ItVecLight=m_VecLight.begin();m_ItVecLight!=m_VecLight.end();m_ItVecLight++)
00135         {
00136                 if(strcmp(m_ItVecLight->GetName(),Name)==0)
00137                 {
00138                         return m_ItVecLight->GetId();
00139                 }
00140         }
00141         return -1;
00142 UnGuard
00143 }
00144 
00145 
00146 char * ExManagerLight::GetNameById(ExId Id)
00147 {
00148 Guard(char * ExManagerLight::GetNameById(ExId Id))
00149         for(m_ItVecLight=m_VecLight.begin();m_ItVecLight!=m_VecLight.end();m_ItVecLight++)
00150         {
00151                 if(m_ItVecLight->GetId()==Id)
00152                 {
00153                         return m_ItVecLight->GetName();
00154                 }
00155         }
00156         return NULL;
00157 UnGuard
00158 }
00159 

Generated on Tue Aug 6 20:27:14 2002 for ExNihilo by doxygen1.2.17