www.pudn.com > uoth_src.zip > RuneBook.h
#ifndef DSSI_RUNEBOOK_H #define DSSI_RUNEBOOK_H //----------------------------------------------------------------------------- // // @doc // // @module RuneBook.h - Rune book information | // // This module contains the rune book 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 CRuneBook { public: enum _Element { Unknown = 0, RuneBook = 1, Name = 2, Treasures = 3, }; enum _Constants { Max_Runes = 16, }; // @access Constructors and destructors public: // @cmember General constructor CRuneBook (); // @cmember General destructor ~CRuneBook (); // @cmember Public methods public: // @cmember Initialize void Init (bool fConstruct); // @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); // @cmember Write the rune library to the output stream void Write (FILE *fp); // @access Protected methods protected: // @cmember Get the element number _Element GetElement (const XML_Char *pszName); // @access Public members public: CString m_strName; int m_anRunes [Max_Runes]; int m_nRunes; }; #endif // DSSI_RUNEBOOK_H