HOG2
|
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< snakeDir > | LoadSnake (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 |
enum SnakeBird::SnakeBirdAnimation : uint8_t |
Enumerator | |
---|---|
kMovement | |
kFall | |
kInitialTeleport | |
kTeleport | |
kWentInGoal | |
kFellInGoal | |
kDoneAnimation | |
kPauseWhenDead | |
kNeedsInitialization |
Definition at line 202 of file SnakeBird.h.
enum SnakeBird::SnakeBirdWorldObject : uint8_t |
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.
enum SnakeBird::snakeDir : uint8_t |
Enumerator | |
---|---|
kLeft | |
kRight | |
kUp | |
kDown | |
kNoDirection |
Definition at line 41 of file SnakeBird.h.
Enumerator | |
---|---|
kNoTeleport | |
kTeleportSuccess | |
kTeleportToExit |
Definition at line 274 of file SnakeBird.h.
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().
|
static |
Definition at line 189 of file SnakeBird.h.
References SnakeBird::SnakeBirdAction::bird, SnakeBird::SnakeBirdAction::direction, kDown, kLeft, kRight, and kUp.
const int SnakeBird::codeSize = 2 |
Definition at line 39 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBird::DeCode(), and SnakeBird::SnakeBird::DecodeLevel().
const uint64_t SnakeBird::fruitMask = 0x1F |
Definition at line 31 of file SnakeBird.h.
const uint8_t SnakeBird::kBlockMask = 0x20 |
Definition at line 243 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBird::CanPush(), SnakeBird::SnakeBird::GetActions(), SnakeBird::SnakeBird::HandleTeleports(), and SnakeBird::SnakeBird::SetGroundType().
const uint8_t SnakeBird::kCanEnterMask = 0x80 |
Definition at line 240 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBird::GetActions().
const int SnakeBird::kDead = 510 |
Definition at line 35 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBird::ApplyAction(), SnakeBird::SnakeBird::ApplyPartialAction(), SnakeBird::SnakeBird::CanPush(), SnakeBird::SnakeBird::DoFall(), SnakeBird::SnakeBird::DoFirstMovement(), SnakeBird::SnakeBird::Draw(), SnakeBird::SnakeBird::GetSuccessors(), SnakeBird::SnakeBird::HandleTeleports(), SnakeBird::SnakeBirdState::IsDead(), SnakeBird::SnakeBirdState::IsInPlay(), SnakeBird::SnakeBird::IsOnSpikes(), and SnakeBird::SnakeBird::Render().
const uint8_t SnakeBird::kGroundMask = 0x40 |
Definition at line 241 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBird::CanPush(), SnakeBird::SnakeBird::GetActions(), and SnakeBird::SnakeBird::HandleTeleports().
const int SnakeBird::kInGoal = 511 |
Definition at line 36 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBird::ApplyAction(), SnakeBird::SnakeBird::ApplyPartialAction(), SnakeBird::SnakeBird::DoFall(), SnakeBird::SnakeBird::Draw(), SnakeBird::SnakeBird::GetActions(), SnakeBird::SnakeBird::GoalTest(), SnakeBird::SnakeBirdState::IsInPlay(), SnakeBird::SnakeBird::IsOnSpikes(), and SnakeBird::SnakeBird::Render().
const uint8_t SnakeBird::kNothingPushed = 0xFF |
Definition at line 37 of file SnakeBird.h.
const uint64_t SnakeBird::kOne = 0x1 |
Definition at line 34 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBirdState::KFruitEaten(), and SnakeBird::SnakeBirdState::ToggleFruitPresent().
const uint8_t SnakeBird::kSnakeMask = 0x10 |
Definition at line 242 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBird::CanPush(), SnakeBird::SnakeBird::GetActions(), and SnakeBird::SnakeBird::HandleTeleports().
const uint64_t SnakeBird::locationMask = 0x1FF |
Definition at line 29 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBirdState::GetObjectLocation(), SnakeBird::SnakeBirdState::SetObjectLocation(), and SnakeBird::SnakeBirdState::SetSnakeHeadLoc().
const uint64_t SnakeBird::snakeBodyMask = 0x3 |
Definition at line 33 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBirdState::GetSnakeDir(), and SnakeBird::SnakeBirdState::SetSnakeDir().
const uint64_t SnakeBird::snakeHeadMask = 0x7 |
Definition at line 32 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBirdState::GetNumSnakes(), and SnakeBird::SnakeBirdState::SetNumSnakes().
const uint64_t SnakeBird::snakeLenMask = 0x1F |
Definition at line 30 of file SnakeBird.h.
Referenced by SnakeBird::SnakeBirdState::GetSnakeBodyEnd(), and SnakeBird::SnakeBirdState::SetSnakeBodyEnd().