MercurySwapObject.h

Go to the documentation of this file.
00001 #ifndef _MERCURYSWAPOBJECT_H
00002 #define _MERCURYSWAPOBJECT_H
00003 
00004 #include <map>
00005 #include "MercuryObject.h"
00006 
00007 using namespace std;
00008 
00009 class MercurySwapObject : public MercuryObject
00010 {
00011 public:
00012     ~MercurySwapObject();
00013 
00014     virtual void Init();
00015 
00016     void AddSwapObject(const MString& key, MercuryObject* obj);
00017     MercuryObject* RemoveSwapObject(const MString& key);
00018     bool SwapTo(const MString& key);
00019 
00020     CLASS_RTTI( MercurySwapObject, MercuryObject );
00021 private:
00022     map< MString, MercuryObject*> m_swapobjects;
00023     MercuryObject* m_currentObject;
00024 };
00025 
00026 #endif
00027 
00028 /* 
00029  * Copyright (c) 2005-2006, Charles Lohr
00030  * All rights reserved.
00031  *
00032  * Redistribution and use in source and binary forms, with or
00033  * without modification, are permitted provided that the following
00034  * conditions are met:
00035  *  -   Redistributions of source code must retain the above
00036  *      copyright notice, this list of conditions and the following disclaimer.
00037  *  -   Redistributions in binary form must reproduce the above copyright
00038  *      notice, this list of conditions and the following disclaimer in
00039  *      the documentation and/or other materials provided with the distribution.
00040  *  -   Neither the name of the Mercury Engine nor the names of its
00041  *      contributors may be used to endorse or promote products derived from
00042  *      this software without specific prior written permission.
00043  *
00044  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00045  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00046  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00047  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
00048  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00049  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00050  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00051  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00052  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00053  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00054  */

Hosted by SourceForge.net Logo