HOG2
Classes | Enumerations | Functions | Variables
SnakeBird Namespace Reference

Classes

class  SnakeBird
 
struct  SnakeBirdAction
 
struct  SnakeBirdAnimationStep
 
struct  SnakeBirdState
 

Enumerations

enum  snakeDir : uint8_t {
  kLeft =0x0, kRight =0x1, kUp =0x2, kDown =0x3,
  kNoDirection =0x4
}
 
enum  SnakeBirdAnimation : uint8_t {
  kMovement, kFall, kInitialTeleport, kTeleport,
  kWentInGoal, kFellInGoal, kDoneAnimation, kPauseWhenDead,
  kNeedsInitialization
}
 
enum  SnakeBirdWorldObject : uint8_t {
  kEmpty = 0x80, kFruit = 0x81, kExit = 0x82, kPortal1 = 0x83,
  kPortal2 = 0x84, kPortal, kGround = 0x40, kSpikes = 0x41,
  kBlock1 = 0x20, kBlock2 = 0x21, kBlock3 = 0x22, kBlock4 = 0x23,
  kSnake1 = 0x10, kSnake2 = 0x11, kSnake3 = 0x12, kSnake4 = 0x13,
  kNothing = 0x0
}
 
enum  TeleportResult { kNoTeleport, kTeleportSuccess, kTeleportToExit }
 

Functions

std::vector< snakeDirLoadSnake (std::vector< snakeDir > snakeBod, int width, int pos, std::vector< char > lvl)
 
static std::ostream & operator<< (std::ostream &out, const SnakeBirdAction &a)
 

Variables

const uint64_t locationMask = 0x1FF
 
const uint64_t snakeLenMask = 0x1F
 
const uint64_t fruitMask = 0x1F
 
const uint64_t snakeHeadMask = 0x7
 
const uint64_t snakeBodyMask = 0x3
 
const uint64_t kOne = 0x1
 
const int kDead = 510
 
const int kInGoal = 511
 
const uint8_t kNothingPushed = 0xFF
 
const int codeSize = 2
 
const uint8_t kCanEnterMask = 0x80
 
const uint8_t kGroundMask = 0x40
 
const uint8_t kSnakeMask = 0x10
 
const uint8_t kBlockMask = 0x20
 

Enumeration Type Documentation

◆ SnakeBirdAnimation

Enumerator
kMovement 
kFall 
kInitialTeleport 
kTeleport 
kWentInGoal 
kFellInGoal 
kDoneAnimation 
kPauseWhenDead 
kNeedsInitialization 

Definition at line 202 of file SnakeBird.h.

◆ SnakeBirdWorldObject

Enumerator
kEmpty 
kFruit 
kExit 
kPortal1 
kPortal2 
kPortal 
kGround 
kSpikes 
kBlock1 
kBlock2 
kBlock3 
kBlock4 
kSnake1 
kSnake2 
kSnake3 
kSnake4 
kNothing 

Definition at line 245 of file SnakeBird.h.

◆ snakeDir

enum SnakeBird::snakeDir : uint8_t
Enumerator
kLeft 
kRight 
kUp 
kDown 
kNoDirection 

Definition at line 41 of file SnakeBird.h.

◆ TeleportResult

Enumerator
kNoTeleport 
kTeleportSuccess 
kTeleportToExit 

Definition at line 274 of file SnakeBird.h.

Function Documentation

◆ LoadSnake()

std::vector<snakeDir> SnakeBird::LoadSnake ( std::vector< snakeDir snakeBod,
int  width,
int  pos,
std::vector< char >  lvl 
)

Definition at line 814 of file SnakeBird.cpp.

References kDown, kLeft, kRight, kUp, and width.

Referenced by SnakeBird::SnakeBird::Load().

◆ operator<<()

static std::ostream& SnakeBird::operator<< ( std::ostream &  out,
const SnakeBirdAction a 
)
static

Variable Documentation

◆ codeSize

const int SnakeBird::codeSize = 2

Definition at line 39 of file SnakeBird.h.

Referenced by SnakeBird::SnakeBird::DeCode(), and SnakeBird::SnakeBird::DecodeLevel().

◆ fruitMask

const uint64_t SnakeBird::fruitMask = 0x1F

Definition at line 31 of file SnakeBird.h.

◆ kBlockMask

const uint8_t SnakeBird::kBlockMask = 0x20

◆ kCanEnterMask

const uint8_t SnakeBird::kCanEnterMask = 0x80

Definition at line 240 of file SnakeBird.h.

Referenced by SnakeBird::SnakeBird::GetActions().

◆ kDead

const int SnakeBird::kDead = 510

◆ kGroundMask

const uint8_t SnakeBird::kGroundMask = 0x40

◆ kInGoal

const int SnakeBird::kInGoal = 511

◆ kNothingPushed

const uint8_t SnakeBird::kNothingPushed = 0xFF

Definition at line 37 of file SnakeBird.h.

◆ kOne

const uint64_t SnakeBird::kOne = 0x1

◆ kSnakeMask

const uint8_t SnakeBird::kSnakeMask = 0x10

◆ locationMask

const uint64_t SnakeBird::locationMask = 0x1FF

◆ snakeBodyMask

const uint64_t SnakeBird::snakeBodyMask = 0x3

◆ snakeHeadMask

const uint64_t SnakeBird::snakeHeadMask = 0x7

◆ snakeLenMask

const uint64_t SnakeBird::snakeLenMask = 0x1F