#include "osl/container/moveVector.h"
#include "osl/record/csaRecord.h"
#include "osl/record/checkDuplicate.h"
#include <boost/algorithm/string/trim.hpp>
#include <boost/functional/hash.hpp>
#include "boost/foreach.hpp"
#include "boost/format.hpp"
#include "boost/multi_array.hpp"
#include <boost/program_options.hpp>
#include <fstream>
#include <iostream>
#include <vector>
Go to the source code of this file.
Typedefs | |
typedef osl::stl::hash_map < std::string, unsigned int, boost::hash< std::string > > | players_t |
typedef boost::multi_array < unsigned int, 4 > | array_t |
Enumerations | |
enum | GameResult { BLACK_WIN = 0, WHITE_WIN, OTHERS, BLACK_WIN = 0, WHITE_WIN, OTHERS } |
Functions | |
array_t | winloss (boost::extents[MAX_PLAYERS][MAX_PLAYERS][2][3]) |
const std::string & | getPlayerName (const unsigned int id) |
unsigned int | setPlayer (const std::string &player) |
void | increment (unsigned int black, unsigned int white, GameResult gr) |
GameResult | getGameResult (const std::string &csa_file, const osl::vector< osl::Move > &moves) |
void | readFile (const std::string &csa_file, osl::record::CheckDuplicate &duplicates) |
void | printTotal (std::ostream &out) |
void | printResult (std::ostream &out) |
int | main (int argc, char **argv) |
Variables | |
static const unsigned int | MAX_PLAYERS = 20 |
< max players More... | |
static players_t | players |
player_a, player_b, a's black 0 or white 1, [wins, losses, others] More... | |
typedef boost::multi_array<unsigned int, 4> array_t |
Definition at line 23 of file count-win-loss.cc.
typedef osl::stl::hash_map<std::string, unsigned int, boost::hash<std::string> > players_t |
Definition at line 19 of file count-win-loss.cc.
enum GameResult |
Enumerator | |
---|---|
BLACK_WIN | |
WHITE_WIN | |
OTHERS | |
BLACK_WIN | |
WHITE_WIN | |
OTHERS |
Definition at line 26 of file count-win-loss.cc.
GameResult getGameResult | ( | const std::string & | csa_file, |
const osl::vector< osl::Move > & | moves | ||
) |
Definition at line 88 of file count-win-loss.cc.
References BLACK_WIN, OTHERS, and WHITE_WIN.
Referenced by readFile().
const std::string& getPlayerName | ( | const unsigned int | id) |
Definition at line 33 of file count-win-loss.cc.
Referenced by printResult(), and printTotal().
void increment | ( | unsigned int | black, |
unsigned int | white, | ||
GameResult | gr | ||
) |
Definition at line 66 of file count-win-loss.cc.
References BLACK_WIN, OTHERS, WHITE_WIN, and winloss().
Referenced by readFile().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 205 of file count-win-loss.cc.
References check_duplicate, files, kisen_filename, osl::record::CheckDuplicate::print(), printResult(), printTotal(), readFile(), run(), store(), and vm.
void printResult | ( | std::ostream & | out) |
Definition at line 172 of file count-win-loss.cc.
References getPlayerName(), and winloss().
Referenced by main().
void printTotal | ( | std::ostream & | out) |
Definition at line 140 of file count-win-loss.cc.
References getPlayerName(), and winloss().
Referenced by main().
void readFile | ( | const std::string & | csa_file, |
osl::record::CheckDuplicate & | duplicates | ||
) |
Definition at line 120 of file count-win-loss.cc.
References osl::BLACK, getGameResult(), osl::record::Record::getMoves(), osl::record::Record::getPlayer(), osl::record::csa::CsaFile::getRecord(), increment(), moves, osl::record::CheckDuplicate::regist(), setPlayer(), and osl::WHITE.
Referenced by main().
unsigned int setPlayer | ( | const std::string & | player) |
Definition at line 45 of file count-win-loss.cc.
References MAX_PLAYERS.
Referenced by osl::hash::HashKey::HashKey(), and readFile().
array_t winloss | ( | boost::extents | [MAX_PLAYERS][MAX_PLAYERS][2][3]) |
Referenced by Result::add(), increment(), Result::printAtDepth(), Result::printByLevel(), printResult(), and printTotal().
|
static |
< max players
player and his/her id
Definition at line 16 of file count-win-loss.cc.
Referenced by setPlayer().
|
static |
player_a, player_b, a's black 0 or white 1, [wins, losses, others]
Definition at line 20 of file count-win-loss.cc.
Referenced by osl::game_playing::GameManager::setComputerPlayer().