LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
MapEditor Class Reference

Allows for editing of a map. More...

#include <mapeditor.h>

Inherits Map.

Public Member Functions

void GenerateBlank (int x, int y)
 
void Insert (int x, int y, std::string name)
 
void Remove (int x, int y)
 
- Public Member Functions inherited from Map
void Draw (std::weak_ptr< Camera > cam)
 
void GenerateStressMap (Json::Value val)
 
int CalculateIndex (int x, int y, int w, int h) const
 
std::set< int > CalculateIndex (Recti area) const
 
CollisionMap GetCollisionMap (const Recti &target, int distance=2)
 
Recti Box () const
 Get the map's box.
 
void LoadTileSet (std::shared_ptr< TileSet > ts)
 Sets the tileset.
 
std::string File () const
 Get the map filename.
 
Json::Value Save ()
 
void Load (Json::Value val)
 
void Load (const std::string &file)
 

Additional Inherited Members

- Protected Attributes inherited from Map
std::vector< TilemTiles
 
Recti mBox
 
std::shared_ptr< TileSetmTileSet
 
std::string mFile
 
CameralastCamera
 
std::set< int > indices
 

Detailed Description

Allows for editing of a map.

Lets you edit the map by inserting or removing tiles

Member Function Documentation

void MapEditor::GenerateBlank ( int  x,
int  y 
)

Generate a blank map that is x tiles wide and y tiles tall

Parameters
xThe width of the map, in tiles
yThe height of the map, in tiles
void MapEditor::Insert ( int  x,
int  y,
std::string  name 
)

Insert a tile at the tile located at some x, y point

Parameters
xThe x coordinate to insert tile at
yThe y coordinate to insert tile at
tileThe tile to insert at the point
void MapEditor::Remove ( int  x,
int  y 
)

Remove a tile at some point, really just performs Insert of the default tile

Parameters
xThe x coordinate to clear
yThe y coordinate to clear

The documentation for this class was generated from the following files: