Box2D Binary Counter
Game Physics with a 2D Physics Engine
Loading...
Searching...
No Matches
CCounter Class Reference

Binary counter. More...

#include <Counter.h>

Collaboration diagram for CCounter:

Public Member Functions

 CCounter (float, float, UINT)
 Constructor.
 
 ~CCounter ()
 Destructor.
 
const UINT GetBitCount () const
 Get number of bits.
 
const Vector2 GetPos (UINT) const
 Get position of a single-bit counter.
 

Private Attributes

CBitCounter ** m_pBitCounter = nullptr
 Array of pointers to single-bit counters.
 
UINT m_nNumBits = 0ULL
 Number of single-bit counters.
 

Detailed Description

A multi-bit counter in Physics World, which is essentially made up of an array of single-bit counters.

Constructor & Destructor Documentation

◆ CCounter()

CCounter::CCounter ( float x,
float y,
UINT n )

Constructor.

Parameters
xX-coordinate of least-significant bit counter.
yY-coordinate of least-significant bit counter.
nNumber of bit counters
Here is the call graph for this function:

Member Function Documentation

◆ GetBitCount()

const UINT CCounter::GetBitCount ( ) const

Reader function for the number of bits.

Returns
Number of bits.
Here is the caller graph for this function:

◆ GetPos()

const Vector2 CCounter::GetPos ( UINT n) const

Reader function for the position of a bit in Render World coordinates.

Parameters
nIndex of the required bit.
Returns
Position of bit in Render World coordinates.
Here is the call graph for this function:
Here is the caller graph for this function: