Horizon Official Technical Documentation
Horizon::Zone::Cell Struct Reference

#include <Cell.hpp>

Public Member Functions

 Cell (uint8_t type)
 
 Cell ()
 
 ~Cell ()
 
void set_type (uint8_t type)
 
map_cell_types get_type ()
 
void validate_type (map_cell_types type)
 
bool isWalkable ()
 
void setWalkable ()
 
bool isShootable ()
 
void setShootable ()
 
bool isWater ()
 
void setWater ()
 

Private Attributes

struct {
   unsigned   _walkable: 1
 
   unsigned   _shootable: 1
 
   unsigned   _is_water: 1
 
   unsigned   unused: 5
 
setting
 
map_cell_types _type {0}
 

Constructor & Destructor Documentation

◆ Cell() [1/2]

Horizon::Zone::Cell::Cell ( uint8_t  type)
inline
45 : _type((map_cell_types) type)
46 {
48 }
map_cell_types
Definition: MapDefinitions.hpp:34
map_cell_types _type
Definition: Cell.hpp:103
void validate_type(map_cell_types type)
Definition: Cell.hpp:63

References _type, and validate_type().

+ Here is the call graph for this function:

◆ Cell() [2/2]

Horizon::Zone::Cell::Cell ( )
inline
51 {
52
53 }

◆ ~Cell()

Horizon::Zone::Cell::~Cell ( )
inline
56 {
57 //
58 }

Referenced by Horizon::Zone::Map::~Map().

+ Here is the caller graph for this function:

Member Function Documentation

◆ get_type()

map_cell_types Horizon::Zone::Cell::get_type ( )
inline
61{ return _type; }

References _type.

Referenced by Horizon::Zone::Map::get_cell_type().

+ Here is the caller graph for this function:

◆ isShootable()

bool Horizon::Zone::Cell::isShootable ( )
inline
90{ return setting._shootable ? true : false; }
struct Horizon::Zone::Cell::@134 setting

References setting.

◆ isWalkable()

bool Horizon::Zone::Cell::isWalkable ( )
inline
87{ return setting._walkable ? true : false; }

References setting.

Referenced by check_collision(), and Horizon::Zone::Map::has_obstruction_at().

+ Here is the caller graph for this function:

◆ isWater()

bool Horizon::Zone::Cell::isWater ( )
inline
93{ return setting._is_water ? true : false; }

References setting.

◆ set_type()

void Horizon::Zone::Cell::set_type ( uint8_t  type)
inline

References _type, and validate_type().

+ Here is the call graph for this function:

◆ setShootable()

void Horizon::Zone::Cell::setShootable ( )
inline
91{ setting._shootable = 1; }

References setting.

Referenced by validate_type().

+ Here is the caller graph for this function:

◆ setWalkable()

void Horizon::Zone::Cell::setWalkable ( )
inline
88{ setting._walkable = 1; }

References setting.

Referenced by validate_type().

+ Here is the caller graph for this function:

◆ setWater()

void Horizon::Zone::Cell::setWater ( )
inline
94{ setting._is_water = 1; }

References setting.

Referenced by validate_type().

+ Here is the caller graph for this function:

◆ validate_type()

void Horizon::Zone::Cell::validate_type ( map_cell_types  type)
inline
64 {
65 switch (type)
66 {
67 case CELL_WALKABLE_SHOOTABLE_WATER: setWater(); // walkable water
69 case CELL_WALKABLE_SHOOTABLE_2: // ???
70 case CELL_WALKABLE_SHOOTABLE_4: // ???
72 case CELL_CLIFF_ONLY_SHOOTABLE_5: setShootable(); // gap (snipable)
73 case CELL_NONWALKABLE_GROUND: break;
74
75// case 0: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // walkable ground
76// case 1: cell.walkable = 0; cell.shootable = 0; cell.water = 0; break; // non-walkable ground
77// case 2: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // ???
78// case 3: cell.walkable = 1; cell.shootable = 1; cell.water = 1; break; // walkable water
79// case 4: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // ???
80// case 5: cell.walkable = 0; cell.shootable = 1; cell.water = 0; break; // gap (snipable)
81// case 6: cell.walkable = 1; cell.shootable = 1; cell.water = 0; break; // ???
82 default:
83 break;
84 }
85 }
@ CELL_NONWALKABLE_GROUND
Definition: MapDefinitions.hpp:36
@ CELL_WALKABLE_SHOOTABLE_2
Definition: MapDefinitions.hpp:37
@ CELL_CLIFF_ONLY_SHOOTABLE_5
Definition: MapDefinitions.hpp:40
@ CELL_WALKABLE_SHOOTABLE_GROUND_0
Definition: MapDefinitions.hpp:35
@ CELL_WALKABLE_SHOOTABLE_6
Definition: MapDefinitions.hpp:41
@ CELL_WALKABLE_SHOOTABLE_4
Definition: MapDefinitions.hpp:39
@ CELL_WALKABLE_SHOOTABLE_WATER
Definition: MapDefinitions.hpp:38
void setShootable()
Definition: Cell.hpp:91
void setWalkable()
Definition: Cell.hpp:88
void setWater()
Definition: Cell.hpp:94

References CELL_CLIFF_ONLY_SHOOTABLE_5, CELL_NONWALKABLE_GROUND, CELL_WALKABLE_SHOOTABLE_2, CELL_WALKABLE_SHOOTABLE_4, CELL_WALKABLE_SHOOTABLE_6, CELL_WALKABLE_SHOOTABLE_GROUND_0, CELL_WALKABLE_SHOOTABLE_WATER, setShootable(), setWalkable(), and setWater().

Referenced by Cell(), and set_type().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _is_water

unsigned Horizon::Zone::Cell::_is_water

◆ _shootable

unsigned Horizon::Zone::Cell::_shootable

◆ _type

map_cell_types Horizon::Zone::Cell::_type {0}
private

Referenced by Cell(), get_type(), and set_type().

◆ _walkable

unsigned Horizon::Zone::Cell::_walkable

◆ 

struct { ... } Horizon::Zone::Cell::setting

◆ unused

unsigned Horizon::Zone::Cell::unused

The documentation for this struct was generated from the following file: