|
|
| Game (const Settings &settings, const IPositionRandomizerPtr &randomizer=MakeShared< PositionRandomizer >()) |
| |
| TSharedPtr< Grid > | grid () const |
| |
| TSharedPtr< Snake > | snake () const |
| |
| TSharedPtr< Food > | food () const |
| |
| void | update (float deltaSeconds, const Input &input) |
| |
|
uint32 | score () const |
| |
|
float | gameTime () const |
| |
|
void | subscribeOnGameplayEvent (GameplayEventCallback callback) |
| |
|
|
void | updateGrid () |
| |
|
bool | updateTime (float deltaSeconds) |
| |
|
bool | died (const Position &prevTailPosition) const |
| |
|
void | generateFood () |
| |
|
bool | foodTaken () const |
| |
|
FORCEINLINE void | dispatchEvent (GameplayEvent Event) |
| |
|
|
const Settings | c_settings |
| |
|
TSharedPtr< Grid > | m_grid |
| |
|
TSharedPtr< Snake > | m_snake |
| |
|
TSharedPtr< Food > | m_food |
| |
|
float | m_moveSeconds {0.0f} |
| |
|
bool | m_gameOver {false} |
| |
|
uint32 | m_score {0} |
| |
|
float | m_gameTime {0.0f} |
| |
|
TArray< GameplayEventCallback > | m_gameplayEventCallbacks |
| |
◆ food()
| TSharedPtr< Food > SnakeGame::Game::food |
( |
| ) |
const |
|
inline |
Returns the pointer to the food object
- Returns
- TSharedPtr<Food> pointer to the food object
◆ grid()
| TSharedPtr< Grid > SnakeGame::Game::grid |
( |
| ) |
const |
|
inline |
Returns the pointer to the grid object
- Returns
- TSharedPtr<Grid> pointer to the grid object
◆ snake()
| TSharedPtr< Snake > SnakeGame::Game::snake |
( |
| ) |
const |
|
inline |
Returns the pointer to the snake object
- Returns
- TSharedPtr<Snake> pointer to the snake object
◆ update()
| void Game::update |
( |
float |
deltaSeconds, |
|
|
const Input & |
input |
|
) |
| |
Updates game
- Parameters
-
| deltaSeconds | delta time |
| input | user input |
The documentation for this class was generated from the following files:
- Source/SnakeGame/Core/Game.h
- Source/SnakeGame/Core/Game.cpp