📄 oasisobjectresource.h
字号:
/******************************************************************************
* This source file is part of Bad Camel Gaming
* Copyright (C) 2003 Zephie Greyvenstein
* See Readme.html for acknowledgements
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
/******************************************************************************
* FILENAME : oasisObjectResource.h
* DESCRIPTION : The object resource
* AUTHOR : Zephie Greyvenstein
*****************************************************************************/
/// Avoid double inclusion
#ifndef __OBJECTRESOURCE_H__
#define __OBJECTRESOURCE_H__
/// Include the common headers
#include "oasisCommon.h"
/// Include the rest of the needed oasis stuff
#include "oasisResource.h"
#include "oasisIterators.h"
#include "oasisVector3.h"
namespace Oasis {
/** The object resource
@remarks
This defines an object template from which application objects can be
created
*/
class _oasisExport objectResource : public resource {
public:
/// Constructor
objectResource( const string &thisName );
/// Deconstructor
virtual ~objectResource( );
/// Sound list used by objects
typedef std::map< string, string > soundEventMap;
/// Gets an iterator to the sound events for this template
typedef mapIterator< soundEventMap > soundEventIterator;
/// Set default absolute scale of object
void setScale( real x, real y, real z );
/// Set default absolute scale of object
void setScale( const vector3 &newScale );
/// Get default absolute scale of object
const vector3 &getScale( void ) const;
/// Set the default entity to use
void setEntity( const string &newMesh );
/// Get the default entity to use
const string &getEntity( void ) const;
/// Add a sound event you want an object of this type to use
void addSound( const string &name, const string &templateName );
/// Remove all sound event defined in this template
void removeAllSounds( void );
/// Remove a sound event from the template
void removeSound( const string &name );
/// Set the physics to use
void setPhysics( const string &newPhysics );
/// Get the physics this template uses
const string &getPhysics( void ) const;
/// Remove the physics from this template
void removePhysics( void );
/// Get an iterator to the sound events for this template
soundEventIterator getSoundEventIterator( void );
private:
/// Object scale
vector3 absScale;
/// Object's entity
string entityName;
/// Physics to use
string physics;
/// Sounds events used by the template. This should be a hash_map
soundEventMap sounds;
/// Loads the resource for this object. Does nothing at the moment
void load( void ) {}
};
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -