www.pudn.com > uoth_src.zip > Level.h
#ifndef DSSI_LEVEL_H #define DSSI_LEVEL_H //----------------------------------------------------------------------------- // // @doc // // @module Level.h - Treasure map level information | // // This module contains the treasure map level information // // Copyright (c) 2002 - Descartes Systems Sciences, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // 2. Neither the name of Descartes Systems Sciences, Inc nor the names of // its contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // @end // // $History: ExpatImpl.h $ // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // // Required include files // //----------------------------------------------------------------------------- #include#include "ExpatImpl.h" //----------------------------------------------------------------------------- // // Forward definitions // //----------------------------------------------------------------------------- class CDataParser; //----------------------------------------------------------------------------- // // Class definition // //----------------------------------------------------------------------------- class CLevel { public: enum _Element { Unknown = 0, Level = 1, Cartography = 2, Lockpicking = 3, Gold = 4, Gems = 5, MagicItems = 6, Scrolls = 7, Reagents = 8, WhatSpawns = 9, WhatDrops = 10, Name = 11, }; // @access Constructors and destructors public: // @cmember General constructor CLevel (); // @cmember General destructor ~CLevel (); // @cmember Public methods public: // @cmember Initialize void Init (bool fConstruct); // @cmember Get information about the level CString GetInformation (bool fTerse); // @cmember Start a treasure void OnStart (CDataParser *pParser, const XML_Char **papszAttrs); // @cmember Start an XML element void OnStartElement (CDataParser *pParser, const XML_Char *pszName, const XML_Char **papszAttrs); // @cmember End an XML element void OnEndElement (CDataParser *pParser, const XML_Char *pszName); // @access Public inline methods public: // @cmember Is this level valid bool IsValid () const { return m_nIndex > 0; } // @access Protected methods protected: // @cmember Get the element number _Element GetElement (const XML_Char *pszName); // @access Public members public: int m_nIndex; int m_nCartography; int m_nLockpicking; int m_nGold; int m_nGems; int m_nMagicItems; int m_nScrolls; int m_nReagents; CString m_strName; CString m_strWhatSpawns; CString m_strWhatDrops; static CAtlArray gm_vLevels; }; #endif // DSSI_LEVEL_H