FireSTARR
Loading...
Searching...
No Matches
fs::Cell Class Reference

A Position with a Slope, Aspect, and Fuel. More...

#include <Cell.h>

Public Member Functions

constexpr SpreadKey fullHash () const
 Full stored hash that may contain data from subclasses.
 
constexpr Cell (const SpreadKey hash) noexcept
 Construct from hash value.
 
constexpr Cell (const SlopeSize slope, const AspectSize aspect, const FuelCodeSize &fuel) noexcept
 Construct based on given attributes.
 
constexpr SpreadKey key () const noexcept
 A key defining Slope, Aspect, and Fuel, used for determining Cells that spread the same.
 
constexpr AspectSize aspect () const noexcept
 Aspect (degrees)
 
constexpr FuelCodeSize fuelCode () const noexcept
 Fuel.
 
constexpr SlopeSize slope () const noexcept
 Slope (degrees)
 

Static Public Member Functions

static constexpr SpreadKey hashCell (const SlopeSize slope, const AspectSize aspect, const FuelCodeSize &fuel) noexcept
 Hash attributes into a SpreadKey value.
 
static constexpr SpreadKey key (const SpreadKey value) noexcept
 A key defining Slope, Aspect, and Fuel, used for determining Cells that spread the same.
 
static constexpr AspectSize aspect (const SpreadKey value) noexcept
 Aspect (degrees)
 
static constexpr FuelCodeSize fuelCode (const SpreadKey value) noexcept
 Fuel.
 
static constexpr SlopeSize slope (const SpreadKey value) noexcept
 Slope (degrees)
 

Protected Attributes

SpreadKey data_
 Stored hash that contains x and y data.
 

Static Protected Attributes

static constexpr uint32_t FuelShift = 0
 Shift for fuel bitmask.
 
static constexpr uint32_t FuelBits = std::bit_width<uint32_t>(NUMBER_OF_FUELS)
 Number of bits in fuel bitmask.
 
static constexpr SpreadKey FuelBitMask = bit_mask<FuelBits, SpreadKey>()
 Bitmask for fuel information in SpreadKey before shift.
 
static constexpr SpreadKey FuelMask = FuelBitMask << FuelShift
 Bitmask for fuel information in SpreadKey.
 
static constexpr uint32_t AspectShift = FuelBits + FuelShift
 Shift for aspect bitmask.
 
static constexpr uint32_t AspectBits = std::bit_width<uint32_t>(MAX_ASPECT)
 Number of bits in aspect bitmask.
 
static constexpr SpreadKey AspectBitMask = bit_mask<AspectBits, SpreadKey>()
 Bitmask for aspect in SpreadKey before shift.
 
static constexpr SpreadKey AspectMask = AspectBitMask << AspectShift
 Bitmask for aspect in SpreadKey.
 
static constexpr uint32_t SlopeShift = AspectBits + AspectShift
 Shift for slope bitmask.
 
static constexpr uint32_t SlopeBits = std::bit_width<uint32_t>(MAX_SLOPE_FOR_DISTANCE)
 Number of bits in slope bitmask.
 
static constexpr SpreadKey SlopeBitMask = bit_mask<SlopeBits, SpreadKey>()
 Bitmask for slope in SpreadKey before shift.
 
static constexpr SpreadKey SlopeMask = SlopeBitMask << SlopeShift
 Bitmask for slope in SpreadKey.
 

Detailed Description

A Position with a Slope, Aspect, and Fuel.

Constructor & Destructor Documentation

◆ Cell() [1/2]

fs::Cell::Cell ( const SpreadKey hash)
inlineexplicitconstexprnoexcept

Construct from hash value.

Parameters
hashHash defining all attributes

◆ Cell() [2/2]

fs::Cell::Cell ( const SlopeSize slope,
const AspectSize aspect,
const FuelCodeSize & fuel )
inlineconstexprnoexcept

Construct based on given attributes.

Parameters
hashHash of x and y
slopeSlope
aspectAspect
fuelFuel

Member Function Documentation

◆ aspect() [1/2]

AspectSize fs::Cell::aspect ( ) const
inlinenodiscardconstexprnoexcept

Aspect (degrees)

Returns
Aspect (degrees)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ aspect() [2/2]

static constexpr AspectSize fs::Cell::aspect ( const SpreadKey value)
inlinestaticnodiscardconstexprnoexcept

Aspect (degrees)

Parameters
valueSpreadKey to extract from
Returns
Aspect (degrees)
Here is the caller graph for this function:

◆ fuelCode() [1/2]

FuelCodeSize fs::Cell::fuelCode ( ) const
inlinenodiscardconstexprnoexcept

Fuel.

Returns
Fuel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fuelCode() [2/2]

static constexpr FuelCodeSize fs::Cell::fuelCode ( const SpreadKey value)
inlinestaticnodiscardconstexprnoexcept

Fuel.

Parameters
valueSpreadKey to extract from
Returns
Fuel
Here is the caller graph for this function:

◆ fullHash()

SpreadKey fs::Cell::fullHash ( ) const
inlinenodiscardconstexpr

Full stored hash that may contain data from subclasses.

Returns
Full stored hash that may contain data from subclasses

◆ hashCell()

static constexpr SpreadKey fs::Cell::hashCell ( const SlopeSize slope,
const AspectSize aspect,
const FuelCodeSize & fuel )
inlinestaticnodiscardconstexprnoexcept

Hash attributes into a SpreadKey value.

Parameters
slopeSlope
aspectAspect
fuelFuel
Returns
Hash
Here is the call graph for this function:

◆ key() [1/2]

SpreadKey fs::Cell::key ( ) const
inlinenodiscardconstexprnoexcept

A key defining Slope, Aspect, and Fuel, used for determining Cells that spread the same.

Returns
A key defining Slope, Aspect, and Fuel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ key() [2/2]

static constexpr SpreadKey fs::Cell::key ( const SpreadKey value)
inlinestaticnodiscardconstexprnoexcept

A key defining Slope, Aspect, and Fuel, used for determining Cells that spread the same.

Parameters
valueSpreadKey to extract from
Returns
A key defining Slope, Aspect, and Fuel

◆ slope() [1/2]

SlopeSize fs::Cell::slope ( ) const
inlinenodiscardconstexprnoexcept

Slope (degrees)

Returns
Slope (degrees)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ slope() [2/2]

static constexpr SlopeSize fs::Cell::slope ( const SpreadKey value)
inlinestaticnodiscardconstexprnoexcept

Slope (degrees)

Parameters
valueSpreadKey to extract from
Returns
Slope (degrees)
Here is the caller graph for this function:

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