These are chat archives for ChaiScript/ChaiScript

4th
Dec 2016
RubenReijers
@RubenReijers
Dec 04 2016 09:55
Does chairscript support "enum classes" ?
StanEpp
@StanEpp
Dec 04 2016 11:34
@RubenReijers yes it does. But it was only added to the develop branch recently. You can do the following when TerrainType is an enum class:
chaiscript::ModulePtr m = chaiscript::ModulePtr(new chaiscript::Module());
chaiscript::utility::add_class<TerrainType>(*m, 
  "TerrainType", 
  { { TerrainType::SOIL, "SOIL" },
    {TerrainType::PASSABLE, "PASSABLE"},
    { TerrainType::STONE, "STONE" }
  }
);
RubenReijers
@RubenReijers
Dec 04 2016 12:20
Thanks a lot :)