Class cell2D

Inheritance Relationships

Base Type

  • public rpdecorator::decorator< fsm::cell2D_fsm >

Class Documentation

class cell2D : public rpdecorator::decorator<fsm::cell2D_fsm>

Representation of a cell on a 2D grid. A combination of FSM + handle to whatever repr::entity2D the cell contains, if any.

Note

Cells can maintain a color. This is a huge performance boost when computing floor colors in ARGoS, as you no longer have to potentially query all blocks/nests/etc only to find out a given location should be empty.

Public Functions

cell2D(const cell2D&) = default
cell2D(void)
crepr::sim_block3D *block3D(void)
crepr::sim_block3D *block3D(void) const

Get the block entity associated with this cell.

Will be NULL unless it contains a block, so check the cell’s state before calling this function.

carepr::base_cache *cache(void)
carepr::base_cache *cache(void) const

Get the cache entity associated with this cell.

Will be NULL unless it contains a cache, so check the cell’s state before calling this function.

inline void color(const rutils::color &color)
inline const rutils::color &color(void) const
inline void entity(repr::spatial_entity *entity)

Set the entity associated with this cell.

inline repr::spatial_entity *entity(void)
inline repr::spatial_entity *entity(void) const
inline fsm::cell2D_fsm &fsm(void)
inline const fsm::cell2D_fsm &fsm(void) const
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
template<typename ...Args>
inline auto Func(Args&&... args) -> decltype(std::declval<decltype(Member)>().Func(args...))
inline void loc(const rmath::vector2z &loc)
inline const rmath::vector2z &loc(void) const
cell2D &operator=(const cell2D&) = delete
inline bool operator==(const cell2D &other) const
inline void reset(void)

Reset the cell to its UNKNOWN state.