Mario: add MapObject and use that instead of tuples
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef MAP_OBJECT_H
|
||||
#define MAP_OBJECT_H
|
||||
|
||||
#include "blocks.hpp"
|
||||
|
||||
class MapObject {
|
||||
public:
|
||||
MapObject() = default;
|
||||
MapObject( uint16_t terrain_id, uint8_t terrain_type, uint8_t character_id,
|
||||
uint8_t character_type, uint8_t modifier_id,
|
||||
uint8_t modifier_data );
|
||||
MapObject( uint16_t terrain_id, LandType::Value terrain_type,
|
||||
uint8_t character_id, LandType::Value character_type,
|
||||
uint8_t modifier_id, uint8_t modifier_data );
|
||||
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( uint8_t id, uint8_t data );
|
||||
void unsetTerrain();
|
||||
void unsetModifier();
|
||||
void unsetCharacter();
|
||||
bool hasCharacter();
|
||||
bool hasModifier();
|
||||
|
||||
uint16_t getTerrainId();
|
||||
uint8_t getCharacterId();
|
||||
uint8_t getModifierId();
|
||||
LandType::Value getTerrainType();
|
||||
LandType::Value getCharacterType();
|
||||
uint8_t getModifierData();
|
||||
|
||||
private:
|
||||
LandType::Value terrain_type = LandType::OVERWORLD;
|
||||
uint16_t terrain_id = 0;
|
||||
LandType::Value character_type = LandType::OVERWORLD;
|
||||
uint8_t character_id = 0;
|
||||
uint8_t modifier_id = 0;
|
||||
uint8_t modifier_data = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user