Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
refbox_state_writer.h
1 
2 /***************************************************************************
3  * refbox_state_writer.h - Fawkes RefBox state writer
4  *
5  * Created: Wed Apr 22 02:32:52 2009
6  * Copyright 2009 Christpoh Schwering
7  * 2008-2009 Tim Niemueller [www.niemueller.de]
8  *
9  ****************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL file in the doc directory.
22  */
23 
24 #ifndef __TOOLS_REFBOXREP_REFBOX_STATE_WRITER_H_
25 #define __TOOLS_REFBOXREP_REFBOX_STATE_WRITER_H_
26 
27 #include "refbox_state_sender.h"
28 
29 #include <blackboard/remote.h>
30 #include <interfaces/GameStateInterface.h>
31 #include <netcomm/worldinfo/enums.h>
32 
33 #include <vector>
34 #include <string>
35 #include <map>
36 
38 {
39  public:
40  RefBoxStateBBWriter(std::vector<std::string> hosts, bool debug = false);
41  virtual ~RefBoxStateBBWriter();
42 
43  virtual void send();
44  virtual void set_gamestate(int game_state,
46  virtual void set_score(unsigned int score_cyan, unsigned int score_magenta);
50 
51  private:
52  void connect(const std::string &host);
53 
54  unsigned int __counter;
55 
56  std::map<fawkes::RemoteBlackBoard *, std::string> __rbbs;
57  std::map<fawkes::RemoteBlackBoard *, fawkes::GameStateInterface *> __giss;
58 
59  bool __debug;
60  int __game_state;
62  unsigned int __score_cyan;
63  unsigned int __score_magenta;
67 };
68 
69 #endif