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: gamestateitem.h,v 1.2 2004/12/30 15:23:26 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 GAMESTATEITEM_H 00023 #define GAMESTATEITEM_H 00024 00025 #include <oxygen/monitorserver/monitoritem.h> 00026 #include <soccer/soccerbase/soccerbase.h> 00027 00028 class GameStateAspect; 00029 00030 class GameStateItem : public oxygen::MonitorItem 00031 { 00032 public: 00033 GameStateItem(); 00034 virtual ~GameStateItem(); 00035 00040 virtual void GetInitialPredicates(oxygen::PredicateList& pList); 00041 00045 virtual void GetPredicates(oxygen::PredicateList& pList); 00046 00048 virtual void OnLink(); 00049 00051 virtual void OnUnlink(); 00052 00053 protected: 00054 void ResetSentFlags(); 00055 00059 void PutFloatParam(const std::string& name, oxygen::PredicateList& pList); 00060 00061 protected: 00062 boost::shared_ptr<GameStateAspect> mGameState; 00063 00064 // flags for sent information 00065 00067 bool mSentLeftTeamname; 00069 bool mSentRightTeamname; 00071 TGameHalf mLastHalf; 00073 int mLastLeftScore; 00075 int mLastRightScore; 00077 TPlayMode mLastPlayMode; 00079 bool mSentFlags; 00080 00081 }; 00082 00083 DECLARE_CLASS(GameStateItem) 00084 00085 #endif // GAMESTATEITEM_H 00086