~ubuntu-branches/ubuntu/oneiric/libclaw/oneiric

« back to all changes in this revision

Viewing changes to examples/game_ai/matches/matches.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Julien Jorge
  • Date: 2010-12-23 20:55:14 UTC
  • mfrom: (4.2.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101223205514-s10m6ywla7s4ttqf
Tags: 1.6.1-3
UploadĀ inĀ sid

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * \file allumettes.hpp
 
3
 * \brief The class representing the state of the game.
 
4
 * \author Julien Jorge
 
5
 */
 
6
#ifndef __MATCHES_HPP__
 
7
#define __MATCHES_HPP__
 
8
 
 
9
#include "claw/game_ai.hpp"
 
10
 
 
11
#include <iostream>
 
12
 
 
13
/**
 
14
 * \brief The class representing the state of the game.
 
15
 * \author Julien Jorge
 
16
 */
 
17
class state_matches:
 
18
  public claw::ai::game::game_state<int>
 
19
{
 
20
private:
 
21
  typedef claw::ai::game::game_state<int> state;
 
22
 
 
23
public:
 
24
  friend std::ostream& operator<<
 
25
  (std::ostream& os, const state_matches& e);
 
26
 
 
27
  state_matches( int matches, bool computer );
 
28
 
 
29
  bool play( int c );
 
30
 
 
31
  //-
 
32
  // methods from game_state
 
33
  //-
 
34
 
 
35
  state* do_action( const int& a ) const;
 
36
  bool final() const;
 
37
  void next_actions( std::list<int>& l ) const;
 
38
  int evaluate() const;
 
39
 
 
40
  //- 
 
41
  // End of the methods from game_state
 
42
  //-
 
43
 
 
44
private:
 
45
  /** \brief Tell if it is the computer's turn. */
 
46
  bool m_computer;
 
47
 
 
48
  /** \brief Remaining matches. */
 
49
  int m_matches;
 
50
 
 
51
}; // state_matches
 
52
 
 
53
#endif // MATCHES_HPP