HOG2
Public Member Functions | Public Attributes | List of all members
SnakeBird::SnakeBirdState Struct Reference

#include <SnakeBird.h>

Public Member Functions

 SnakeBirdState ()
 
void Reset ()
 
bool operator== (const SnakeBirdState &s) const
 
int GetNumSnakes () const
 
void SetNumSnakes (int count)
 
bool IsDead (int whichSnake) const
 
bool IsInPlay (int whichSnake) const
 
int GetSnakeHeadLoc (int whichSnake) const
 
void SetSnakeHeadLoc (int whichSnake, int loc)
 
int GetSnakeBodyEnd (int whichSnake) const
 
void SetSnakeBodyEnd (int whichSnake, int endOffset)
 
void SetSnakeLength (int whichSnake, int len)
 
int GetSnakeLength (int whichSnake) const
 
snakeDir GetSnakeDir (int whichSnake, int segment) const
 
void SetSnakeDir (int whichSnake, int segment, snakeDir dir)
 
void InsertSnakeDir (int whichSnake, snakeDir dir)
 
void InsertSnakeHeadDir (int whichSnake, snakeDir dir)
 
uint64_t GetBodyBits (int whichSnake) const
 
void SetBodyBits (int whichSnake, uint64_t bodyBits)
 
void MakeSnakeLonger (int whichSnake)
 
void MakeSnakeLonger (int whichSnake, snakeDir addDir)
 
int GetObjectLocation (int whichObstacle) const
 
void SetObjectLocation (int whichObstacle, int loc)
 
bool GetFruitPresent (int which) const
 
void ToggleFruitPresent (int which)
 
bool KFruitEaten (int k) const
 

Public Attributes

uint64_t snakeBodies
 
uint64_t snakeHeads
 
uint64_t locBlockFruit
 

Detailed Description

Definition at line 44 of file SnakeBird.h.

Constructor & Destructor Documentation

◆ SnakeBirdState()

SnakeBird::SnakeBirdState::SnakeBirdState ( )
inline

Definition at line 49 of file SnakeBird.h.

Member Function Documentation

◆ GetBodyBits()

uint64_t SnakeBird::SnakeBirdState::GetBodyBits ( int  whichSnake) const
inline

Definition at line 123 of file SnakeBird.h.

References GetSnakeBodyEnd(), and snakeBodies.

Referenced by SnakeBird::SnakeBird::Draw(), MakeSnakeLonger(), and SetSnakeLength().

◆ GetFruitPresent()

bool SnakeBird::SnakeBirdState::GetFruitPresent ( int  which) const
inline

◆ GetNumSnakes()

int SnakeBird::SnakeBirdState::GetNumSnakes ( ) const
inline

◆ GetObjectLocation()

int SnakeBird::SnakeBirdState::GetObjectLocation ( int  whichObstacle) const
inline

◆ GetSnakeBodyEnd()

int SnakeBird::SnakeBirdState::GetSnakeBodyEnd ( int  whichSnake) const
inline

◆ GetSnakeDir()

snakeDir SnakeBird::SnakeBirdState::GetSnakeDir ( int  whichSnake,
int  segment 
) const
inline

◆ GetSnakeHeadLoc()

int SnakeBird::SnakeBirdState::GetSnakeHeadLoc ( int  whichSnake) const
inline

◆ GetSnakeLength()

int SnakeBird::SnakeBirdState::GetSnakeLength ( int  whichSnake) const
inline

◆ InsertSnakeDir()

void SnakeBird::SnakeBirdState::InsertSnakeDir ( int  whichSnake,
snakeDir  dir 
)
inline

Definition at line 98 of file SnakeBird.h.

References GetSnakeBodyEnd(), and snakeBodies.

Referenced by SnakeBird::SnakeBird::DoFirstMovement().

◆ InsertSnakeHeadDir()

void SnakeBird::SnakeBirdState::InsertSnakeHeadDir ( int  whichSnake,
snakeDir  dir 
)
inline

Definition at line 111 of file SnakeBird.h.

References GetSnakeBodyEnd(), and snakeBodies.

Referenced by SnakeBird::SnakeBird::DoFirstMovement().

◆ IsDead()

bool SnakeBird::SnakeBirdState::IsDead ( int  whichSnake) const
inline

Definition at line 56 of file SnakeBird.h.

References GetSnakeHeadLoc(), and SnakeBird::kDead.

◆ IsInPlay()

bool SnakeBird::SnakeBirdState::IsInPlay ( int  whichSnake) const
inline

Definition at line 58 of file SnakeBird.h.

References GetSnakeHeadLoc(), SnakeBird::kDead, and SnakeBird::kInGoal.

◆ KFruitEaten()

bool SnakeBird::SnakeBirdState::KFruitEaten ( int  k) const
inline

◆ MakeSnakeLonger() [1/2]

void SnakeBird::SnakeBirdState::MakeSnakeLonger ( int  whichSnake)
inline

◆ MakeSnakeLonger() [2/2]

void SnakeBird::SnakeBirdState::MakeSnakeLonger ( int  whichSnake,
snakeDir  addDir 
)
inline

◆ operator==()

bool SnakeBird::SnakeBirdState::operator== ( const SnakeBirdState s) const
inline

Definition at line 51 of file SnakeBird.h.

References locBlockFruit, snakeBodies, and snakeHeads.

◆ Reset()

void SnakeBird::SnakeBirdState::Reset ( )
inline

Definition at line 50 of file SnakeBird.h.

References locBlockFruit, snakeBodies, and snakeHeads.

◆ SetBodyBits()

void SnakeBird::SnakeBirdState::SetBodyBits ( int  whichSnake,
uint64_t  bodyBits 
)
inline

Definition at line 131 of file SnakeBird.h.

References GetSnakeBodyEnd(), and snakeBodies.

Referenced by MakeSnakeLonger(), and SetSnakeLength().

◆ SetNumSnakes()

void SnakeBird::SnakeBirdState::SetNumSnakes ( int  count)
inline

Definition at line 55 of file SnakeBird.h.

References SnakeBird::snakeHeadMask, and snakeHeads.

◆ SetObjectLocation()

void SnakeBird::SnakeBirdState::SetObjectLocation ( int  whichObstacle,
int  loc 
)
inline

◆ SetSnakeBodyEnd()

void SnakeBird::SnakeBirdState::SetSnakeBodyEnd ( int  whichSnake,
int  endOffset 
)
inline

◆ SetSnakeDir()

void SnakeBird::SnakeBirdState::SetSnakeDir ( int  whichSnake,
int  segment,
snakeDir  dir 
)
inline

Definition at line 92 of file SnakeBird.h.

References GetSnakeBodyEnd(), snakeBodies, and SnakeBird::snakeBodyMask.

◆ SetSnakeHeadLoc()

void SnakeBird::SnakeBirdState::SetSnakeHeadLoc ( int  whichSnake,
int  loc 
)
inline

◆ SetSnakeLength()

void SnakeBird::SnakeBirdState::SetSnakeLength ( int  whichSnake,
int  len 
)
inline

◆ ToggleFruitPresent()

void SnakeBird::SnakeBirdState::ToggleFruitPresent ( int  which)
inline

Definition at line 168 of file SnakeBird.h.

References SnakeBird::kOne, and locBlockFruit.

Referenced by SnakeBird::SnakeBird::DoFirstMovement().

Member Data Documentation

◆ locBlockFruit

uint64_t SnakeBird::SnakeBirdState::locBlockFruit

◆ snakeBodies

uint64_t SnakeBird::SnakeBirdState::snakeBodies

◆ snakeHeads

uint64_t SnakeBird::SnakeBirdState::snakeHeads

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