00001 /* 00002 ** TowBowlTactics, an adaptation of the tabletop game Blood Bowl. 00003 ** 00004 ** Copyright (C) 2006 The TBT Team. 00005 ** 00006 ** This program is free software; you can redistribute it and/or 00007 ** modify it under the terms of the GNU General Public License 00008 ** as published by the Free Software Foundation; either version 2 00009 ** of the License, or (at your option) any later version. 00010 ** 00011 ** The complete GNU General Public Licence Notice can be found as the 00012 ** `NOTICE' file in the root directory. 00013 ** 00014 ** The TBT Team consists of people listed in the `AUTHORS' file. 00015 */ 00016 #ifndef TEAMHANDLER_HH_ 00017 #define TEAMHANDLER_HH_ 00018 00019 #include <xercesc/sax/HandlerBase.hpp> 00020 #include <vector> 00021 #include <string> 00022 #include "common/Team.hh" 00023 #include "common/Player.hh" 00024 00025 XERCES_CPP_NAMESPACE_USE 00026 00027 class TeamHandler: public HandlerBase 00028 { 00029 public: 00030 static Team* team_; 00031 00032 // ----------------------------------------------------------------------- 00033 // Constructors 00034 // ----------------------------------------------------------------------- 00035 TeamHandler(); 00036 virtual ~TeamHandler(); 00037 00038 // ----------------------------------------------------------------------- 00039 // Implementations of the SAX ErrorHandler interface 00040 // ----------------------------------------------------------------------- 00041 void warning(const SAXParseException& exc); 00042 void error(const SAXParseException& exc); 00043 void fatalError(const SAXParseException& exc); 00044 00045 // ----------------------------------------------------------------------- 00046 // Handlers for the SAX DocumentHandler interface 00047 // ----------------------------------------------------------------------- 00048 void startDocument(); 00049 void startElement(const XMLCh* const name, AttributeList& attributes); 00050 void characters(const XMLCh* const chars, const unsigned int length); 00051 void endElement(const XMLCh* const name); 00052 00053 private: 00054 // ----------------------------------------------------------------------- 00055 // Private data members 00056 // ----------------------------------------------------------------------- 00057 std::string currentNode_; 00058 Player* currentPlayer_; 00059 int currentPlayerNumber_; 00060 }; 00061 00062 #endif /*TEAMHANDLER_HH_*/
1.4.7