00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- 00002 00003 this file is part of rcssserver3D 00004 Fri May 9 2003 00005 Copyright (C) 2002,2003 Koblenz University 00006 Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group 00007 $Id: soccermonitor.h,v 1.2 2004/12/30 15:56:22 rollmark Exp $ 00008 00009 This program is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation; version 2 of the License. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00021 */ 00022 #ifndef SPARK_SOCCERMONITOR_H 00023 #define SPARK_SOCCERMONITOR_H 00024 00025 #include <oxygen/monitorserver/custommonitor.h> 00026 #include <soccer/soccertypes.h> 00027 #include <map> 00028 #include <string> 00029 00030 class SoccerMonitor : public oxygen::CustomMonitor 00031 { 00032 public: 00033 enum EPredicate 00034 { 00035 P_PLAYMODES, 00036 P_TIME, 00037 P_PLAYMODE, 00038 P_HALF 00039 }; 00040 00041 typedef std::map<std::string, EPredicate> TPredicateMap; 00042 00043 public: 00044 SoccerMonitor(); 00045 virtual ~SoccerMonitor(); 00046 00051 virtual void ParseCustomPredicates(const oxygen::PredicateList& pList); 00052 00053 TTime GetTime() const; 00054 00055 TPlayMode GetPlayMode() const; 00056 std::string GetPlayModeString() const; 00057 00058 TGameHalf GetGameHalf() const; 00059 std::string GetGameHalfString() const; 00060 00061 protected: 00062 void ParsePredicates(const oxygen::PredicateList& pList); 00063 void ParsePlayModes(const oxygen::Predicate& pred); 00064 00065 protected: 00066 void SetupPredicateMap(); 00067 00068 protected: 00069 TPredicateMap mPredMap; 00070 00071 float mTime; 00072 int mPlayMode; 00073 int mHalf; 00074 00075 std::vector<std::string> mPlayModes; 00076 }; 00077 00078 DECLARE_CLASS(SoccerMonitor); 00079 00080 #endif // SPARKMONITORCLIENT_H