2021-06-07 21:48:28 +00:00
|
|
|
#ifndef MAP_OBJECT_H
|
|
|
|
#define MAP_OBJECT_H
|
|
|
|
|
|
|
|
#include "blocks.hpp"
|
|
|
|
|
|
|
|
class MapObject {
|
|
|
|
public:
|
|
|
|
MapObject() = default;
|
2021-10-18 07:08:35 +00:00
|
|
|
MapObject(uint16_t terrain_id, uint8_t terrain_type, uint8_t character_id,
|
|
|
|
uint8_t character_type, uint32_t modifier_id,
|
2022-11-13 19:56:20 +00:00
|
|
|
uint8_t modifier_data, const std::string &modifier_text);
|
2021-10-18 07:08:35 +00:00
|
|
|
MapObject(uint16_t terrain_id, LandType::Value terrain_type,
|
|
|
|
uint8_t character_id, LandType::Value character_type,
|
2022-11-13 19:56:20 +00:00
|
|
|
uint32_t modifier_id, uint8_t modifier_data, const std::string &modifier_text);
|
2021-10-18 07:08:35 +00:00
|
|
|
void setTerrain(uint16_t id, LandType::Value land_type);
|
|
|
|
void setTerrain(uint16_t id, uint8_t land_type);
|
|
|
|
void setCharacter(uint8_t id, LandType::Value land_type);
|
|
|
|
void setCharacter(uint8_t id, uint8_t land_type);
|
|
|
|
void setModifier(uint32_t id, uint8_t data);
|
2022-11-13 19:56:20 +00:00
|
|
|
void setModifier(uint32_t id, const std::string &text);
|
2021-06-07 21:48:28 +00:00
|
|
|
void unsetTerrain();
|
|
|
|
void unsetModifier();
|
|
|
|
void unsetCharacter();
|
|
|
|
bool hasCharacter();
|
|
|
|
bool hasModifier();
|
|
|
|
|
|
|
|
uint16_t getTerrainId();
|
|
|
|
uint8_t getCharacterId();
|
2021-08-08 19:36:47 +00:00
|
|
|
uint32_t getModifierId();
|
2021-06-07 21:48:28 +00:00
|
|
|
LandType::Value getTerrainType();
|
|
|
|
LandType::Value getCharacterType();
|
|
|
|
uint8_t getModifierData();
|
2022-11-13 19:56:20 +00:00
|
|
|
const std::string &getModifierText();
|
2021-06-07 21:48:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
LandType::Value terrain_type = LandType::OVERWORLD;
|
|
|
|
uint16_t terrain_id = 0;
|
|
|
|
LandType::Value character_type = LandType::OVERWORLD;
|
|
|
|
uint8_t character_id = 0;
|
2021-08-08 19:36:47 +00:00
|
|
|
uint32_t modifier_id = 0;
|
2021-06-07 21:48:28 +00:00
|
|
|
uint8_t modifier_data = 0;
|
2022-11-13 19:56:20 +00:00
|
|
|
std::string modifier_text = "";
|
2021-06-07 21:48:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|