Skip to content

Commit

Permalink
pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed May 26, 2024
1 parent be7605d commit 3a43450
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions open_spiel/julia/src/OpenSpiel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ using CxxWrap
import CxxWrap:argument_overloads
import Base: step, first, last

struct PlayerAction
player::Int32
action::Int64
end

@wrapmodule(LIB_OPEN_SPIEL)

include("patch.jl")
Expand Down
6 changes: 3 additions & 3 deletions open_spiel/julia/wrapper/spieljl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ template <>
struct jlcxx::IsMirroredType<std::pair<open_spiel::Action, double>>
: std::true_type {};

template <>
struct jlcxx::IsMirroredType<open_spiel::State::PlayerAction> : std::true_type {};

template <typename K, typename V>
struct jlcxx::julia_type_factory<std::pair<K, V>> {
static jl_datatype_t* julia_type() {
Expand All @@ -126,6 +123,9 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& mod) {
jlcxx::stl::apply_stl<std::vector<int>>(mod);
jlcxx::stl::apply_stl<std::vector<std::vector<int>>>(mod);
jlcxx::stl::apply_stl<std::vector<open_spiel::Action>>(mod);

mod.map_type<open_spiel::State::PlayerAction>("PlayerAction");
jlcxx::stl::apply_stl<std::vector<open_spiel::State::PlayerAction>>(mod);

mod.add_bits<open_spiel::GameParameter::Type>("GameParameterStateType",
jlcxx::julia_type("CppEnum"));
Expand Down

0 comments on commit 3a43450

Please sign in to comment.