Skip to content

Commit

Permalink
Use original ACPC in latest version as dependency only
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Jöst committed Oct 23, 2019
1 parent 176f167 commit 5339240
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 4 additions & 4 deletions open_spiel/games/universal_poker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ set(HEADER_FILES
)

set(CLIB_FILES
acpc/game.h
acpc/game.c
acpc/rng.h
acpc/rng.c)
acpc/project_acpc_server/game.h
acpc/project_acpc_server/game.c
acpc/project_acpc_server/rng.h
acpc/project_acpc_server/rng.c)

set(SOURCE_FILES
acpc_cpp/acpc_game.cc
Expand Down
10 changes: 8 additions & 2 deletions open_spiel/games/universal_poker/acpc_cpp/acpc_game.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#include <sstream>
#include <assert.h>
#include <ostream>
#include <string.h>

extern "C"
{
#include "open_spiel/games/universal_poker/acpc/game.h"
#include "open_spiel/games/universal_poker/acpc/project_acpc_server/game.h"
};

namespace open_spiel::universal_poker::acpc_cpp {
Expand Down Expand Up @@ -45,7 +46,12 @@ namespace open_spiel::universal_poker::acpc_cpp {
gameDef.copy(buf, STRING_BUFFERSIZE);

FILE *f = fmemopen(&buf, STRING_BUFFERSIZE, "r");
readGame(f, acpcGame);
::Game* game = readGame(f);

memcpy(acpcGame, game, sizeof(Game));


free(game);
fclose(f);
}

Expand Down
4 changes: 2 additions & 2 deletions open_spiel/games/universal_poker/logic/card_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ std::string suitChars = "cdhs";
std::string rankChars = "23456789TJQKA";

extern "C" {
#include "open_spiel/games/universal_poker/acpc/game.h"
#include "open_spiel/games/universal_poker/acpc/evalHandTables"
#include "open_spiel/games/universal_poker/acpc/project_acpc_server/game.h"
#include "open_spiel/games/universal_poker/acpc/project_acpc_server/evalHandTables"
}

namespace open_spiel::universal_poker::logic {
Expand Down

0 comments on commit 5339240

Please sign in to comment.