include/chaiscript/extras/tmxparser.hpp
/**
       * Adds the Map to the ChaiScript module.
       */
Adds the Map to the ChaiScript module.
Adds the Map to the ChaiScript module .
ModulePtr addMap(ModulePtr m = std::make_shared<Module>()) {
        addMapEnums(m);
        m->add(user_type<Tmx::Map>(), "TmxMap");
        m->add(constructor<Tmx::Map()>(), "TmxMap");
        m->add(fun(&Tmx::Map::ParseFile), "ParseFile");
        m->add(fun(&Tmx::Map::ParseText), "ParseText");
        m->add(fun(&Tmx::Map::GetFilename), "GetFilename");
        m->add(fun(&Tmx::Map::GetFilepath), "GetFilepath");
        m->add(fun(&Tmx::Map::GetVersion), "GetVersion");
        m->add(fun(&Tmx::Map::GetWidth), "GetWidth");
        m->add(fun(&Tmx::Map::GetHeight), "GetHeight");
        m->add(fun(&Tmx::Map::GetTileWidth), "GetTileWidth");
        m->add(fun(&Tmx::Map::GetTileHeight), "GetTileHeight");
        m->add(fun(&Tmx::Map::GetNextObjectId), "GetNextObjectId");
        m->add(fun(&Tmx::Map::GetHexsideLength), "GetHexsideLength");
        m->add(fun(&Tmx::Map::GetNumLayers), "GetNumLayers");
        m->add(fun(&Tmx::Map::GetNumTileLayers), "GetNumTileLayers");
        m->add(fun(&Tmx::Map::GetNumObjectGroups), "GetNumObjectGroups");
        m->add(fun(&Tmx::Map::GetNumImageLayers), "GetNumImageLayers");
        m->add(fun(&Tmx::Map::GetNumGroupLayers), "GetNumGroupLayers");
        m->add(fun(&Tmx::Map::FindTilesetIndex), "FindTilesetIndex");
        m->add(fun(&Tmx::Map::GetNumTilesets), "GetNumTilesets");
        m->add(fun(&Tmx::Map::HasError), "HasError");
        m->add(fun(&Tmx::Map::GetErrorCode), "GetErrorCode");
        m->add(fun(&Tmx::Map::GetBackgroundColor), "GetBackgroundColor");
        m->add(fun(&Tmx::Map::GetOrientation), "GetOrientation");
        m->add(fun(&Tmx::Map::GetRenderOrder), "GetRenderOrder");
        m->add(fun(&Tmx::Map::GetStaggerAxis), "GetStaggerAxis");
        m->add(fun(&Tmx::Map::GetStaggerIndex), "GetStaggerIndex");
        m->add(fun(&Tmx::Map::GetLayer), "GetLayer");
        m->add(fun(&Tmx::Map::GetLayers), "GetLayers");
        return m;
      }
ModulePtr addMap ( ModulePtr m = std :: make_shared < Module > ( ) ) { addMapEnums ( m ) ; m -> add ( user_type < Tmx :: Map > ( ) , " " ) ; m -> add ( constructor < Tmx :: Map ( ) > ( ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: ParseFile ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: ParseText ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetFilename ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetFilepath ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetVersion ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetWidth ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetHeight ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetTileWidth ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetTileHeight ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetNextObjectId ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetHexsideLength ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetNumLayers ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetNumTileLayers ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetNumObjectGroups ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetNumImageLayers ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetNumGroupLayers ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: FindTilesetIndex ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetNumTilesets ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: HasError ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetErrorCode ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetBackgroundColor ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetOrientation ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetRenderOrder ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetStaggerAxis ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetStaggerIndex ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetLayer ) , " " ) ; m -> add ( fun ( & Tmx :: Map :: GetLayers ) , " " ) ; return m ; }
Adds the Map to the ChaiScript module.
Adds the Map to the ChaiScript module .
//m->add(chaiscript::bootstrap::standard_library::vector_type<std::vector<Tmx::Layer*>>("VectorTmxLayer")); // TODO: Add the remaining functions. //const Tmx::TileLayer *GetTileLayer(int index) const { return tile_layers.at(index); } //const std::vector< Tmx::TileLayer* > &GetTileLayers() const { return tile_layers; } //const Tmx::ObjectGroup *GetObjectGroup(int index) const { return object_groups.at(index); } //const std::vector< Tmx::ObjectGroup* > &GetObjectGroups() const { return object_groups; } //const Tmx::ImageLayer *GetImageLayer(int index) const { return image_layers.at(index); } //const std::vector< Tmx::ImageLayer* > &GetImageLayers() const { return image_layers; } //const Tmx::GroupLayer *GetGroupLayer(int index) const { return group_layers.at(index); } //const std::vector< Tmx::GroupLayer* > &GetGroupLayers() const { return group_layers; } //const Tmx::Tileset *FindTileset(int gid) const; //const Tmx::Tileset *GetTileset(int index) const { return tilesets.at(index); } //const std::vector< Tmx::Tileset* > &GetTilesets() const { return tilesets; } //const std::string &GetErrorText() const { return error_text; } //const Tmx::PropertySet &GetProperties() const { return properties; }