Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Nazar2347/Snake
/ functions
Functions
99 in github.com/Nazar2347/Snake
⨍
Functions
99
◇
Types & classes
54
↓ 25 callers
Method
GetHeadPosition
* @brief Gets the current position of the snake's head. * @return The position of the head. */
source/core/public/Snake.h:42
↓ 18 callers
Method
GetPosition
Returns the current position of the food
source/core/private/IFood.cpp:19
↓ 17 callers
Method
GetTailPosition
Returns a copy of the current tail positions.
source/core/private/Snake.cpp:14
↓ 16 callers
Method
GetCellInfo
Returns the cell type at the given position, or OUT_OF_BORDER if not found
source/core/private/Board.cpp:53
↓ 12 callers
Method
SetCellType
Sets the cell type at the given position if it exists
source/core/private/Board.cpp:63
↓ 11 callers
Method
ChangeTailSizeBy
Changes the size of the snake's tail by the given amount (positive to grow, negative to shrink)
source/core/private/Snake.cpp:25
↓ 10 callers
Method
SetDirection
Sets the direction of the snake's movement
source/core/private/Snake.cpp:185
↓ 9 callers
Method
isAlive
* @brief Checks if the snake is alive. * @return True if the snake is alive, false otherwise. */
source/core/public/Snake.h:63
↓ 8 callers
Method
Move
source/core/private/IFood.cpp:57
↓ 7 callers
Method
Draw
Draws the button texture at its position
source/render/private/Button.cpp:19
↓ 7 callers
Method
GetGameUI
source/app/Game/Game.cpp:211
↓ 6 callers
Method
GetFoodType
Returns the type of the food
source/core/private/IFood.cpp:37
↓ 5 callers
Method
SetCurrentState
source/app/Game/Game.cpp:216
↓ 4 callers
Method
DoSomething
AppleFood does nothing special when activated
source/core/private/IFood.cpp:53
↓ 4 callers
Method
DrawBackgorund
Draws background
source/render/private/GameUI.cpp:76
↓ 4 callers
Method
GetEmptyCell
Finds and returns the first empty cell position, or {1,1} if none found
source/core/private/Board.cpp:78
↓ 4 callers
Method
GetHeadDirection
source/core/public/Snake.h:83
↓ 4 callers
Method
GetLevelXSize
Returns the width of the board
source/core/private/Board.cpp:91
↓ 4 callers
Method
GetLevelYSize
Returns the height of the board
source/core/private/Board.cpp:97
↓ 4 callers
Method
GetRandomValue
source/core/private/Utilities.cpp:8
↓ 3 callers
Method
DrawGameUI
source/render/private/GameUI.cpp:28
↓ 3 callers
Function
EmptyLevelData
Helper: Create a simple 3x3 Board1 with all cells empty
tests/TestIFood.cpp:6
↓ 3 callers
Method
GetDirection
* @brief Gets the current direction of the snake's head. * @return The current direction. */
source/core/public/Snake.h:78
↓ 3 callers
Method
RenderOnPlay
Renders all game components
source/app/Game/Game.cpp:167
↓ 3 callers
Method
StartCountingGameScore
source/render/private/GameUI.cpp:55
↓ 3 callers
Method
isClicked
Returns true if the button is clicked with the mouse
source/render/private/Button.cpp:25
↓ 2 callers
Method
GetPoints
Returns the points value of the food
source/core/private/IFood.cpp:25
↓ 2 callers
Method
InitializeLevel
source/app/Game/Game.cpp:75
↓ 2 callers
Method
IsRestartButtonClicked
source/render/private/GameUI.cpp:86
↓ 2 callers
Method
getLevelData
Returns the entire board map (positions and their cell types)
source/core/private/Board.cpp:72
↓ 1 callers
Method
DrawGameOverLabel
Draws the game over label and restart button
source/render/private/GameUI.cpp:69
↓ 1 callers
Method
DrawMenu
Draws the main menu background and buttons
source/render/private/GameUI.cpp:21
↓ 1 callers
Method
DrawWinLabel
Draws the win label and restart button
source/render/private/GameUI.cpp:62
↓ 1 callers
Method
HandleInput
Checks for key presses and returns the corresponding command object.
source/core/private/InputHandler.cpp:15
↓ 1 callers
Method
IsExitButtonClicked
source/render/private/GameUI.cpp:91
↓ 1 callers
Method
IsGameOver
Returns true if the snake is dead
source/app/Game/Game.cpp:178
↓ 1 callers
Method
IsGameWin
source/app/Game/Game.cpp:221
↓ 1 callers
Method
IsLevelCompleted
Returns true if all food has been consumed
source/app/Game/Game.cpp:188
↓ 1 callers
Method
IsStartButtonClicked
source/render/private/GameUI.cpp:81
↓ 1 callers
Method
ProcessInput
source/app/Game/Game.cpp:105
↓ 1 callers
Method
ProcessInputOnGame
Handles player input and executes commands
source/app/Game/Game.cpp:111
↓ 1 callers
Method
Render
source/app/Game/Game.cpp:161
↓ 1 callers
Method
Update
source/app/Game/Game.cpp:120
↓ 1 callers
Method
UpdateOnPlay
Updates game logic: snake movement, food interaction, and level state
source/app/Game/Game.cpp:125
↓ 1 callers
Method
execute
Executes the "move up" command by setting the snake's direction to UP.
source/core/private/Command.cpp:9
Method
AppleFood
AppleFood constructor: sets type to APPLE
source/core/private/IFood.cpp:47
Method
Board
Constructor: Initializes the board with the given level data
source/core/private/Board.cpp:22
Method
Button
Constructor: loads and resizes the button image, then creates a texture
source/render/private/Button.cpp:4
Method
CheckPosition
source/core/private/IObject.cpp:9
Method
Draw
Draws the entire snake (head, body, tail) if the Snake pointer is valid. Otherwise, displays an error message on the board.
source/render/private/RenderSnake.cpp:22
Method
Draw
Draws the given food object using the appropriate texture or a red rectangle if type is unknown
source/render/private/RenderFood.cpp:19
Method
Draw
Draws the board and its cells
source/render/private/RenderBoard.cpp:28
Method
DrawBackground
Draws the background rectangle for the board
source/render/private/RenderBoard.cpp:82
Method
DrawBody
Draws the snake's body segments, choosing the correct texture for straight or turning segments.
source/render/private/RenderSnake.cpp:71
Method
DrawHead
Draws the snake's head using the correct texture based on the current direction.
source/render/private/RenderSnake.cpp:49
Method
DrawSnakePart
Draws a single part of the snake (head, body, or tail) at the specified board position.
source/render/private/RenderSnake.cpp:40
Method
DrawTail
Draws the snake's tail using the correct texture based on the direction of the last segment.
source/render/private/RenderSnake.cpp:119
Method
FoodRender
Constructor: Loads images and creates textures for each food type
source/render/private/RenderFood.cpp:4
Method
Frog
Frog constructor: sets type to FROG and initializes movement
source/core/private/IFood.cpp:63
Method
Game
Constructor: initializes level based on enum
source/app/Game/Game.cpp:65
Method
GameState
source/app/Game/GameState.cpp:6
Method
GameState_Lose
source/app/Game/GameState.cpp:105
Method
GameState_Menu
source/app/Game/GameState.cpp:13
Method
GameState_Play
source/app/Game/GameState.cpp:42
Method
GameState_Win
source/app/Game/GameState.cpp:79
Method
GameUI
Constructor: initializes UI state, loads textures, and creates buttons
source/render/private/GameUI.cpp:5
Method
GetAmountFoodLeft
Returns how many food items are left on the level
source/app/Game/Game.cpp:194
Method
IFood
IFood constructor: initializes food with points, position, and board reference
source/core/private/IFood.cpp:5
Method
IObject
Deleted copy constructor and copy assignment operator
source/core/public/IObject.h:26
Method
IObject
source/core/private/IObject.cpp:4
Method
InitializeLevel1
source/app/Game/Game.cpp:232
Method
InitializeLevel2
source/app/Game/Game.cpp:253
Method
InitializeLevel3
source/app/Game/Game.cpp:275
Method
InputHandler
Constructor: Initializes command objects for each input direction and a null command.
source/core/private/InputHandler.cpp:5
Method
Mouse
Mouse constructor: sets type to MOUSE and initializes movement
source/core/private/IFood.cpp:101
Method
Move
Moves the snake in the current direction, updates board and tail positions
source/core/private/Snake.cpp:86
Method
ProcessInput
source/app/Game/GameState.cpp:28
Method
RandomNumberGenerator
source/core/private/Utilities.cpp:3
Method
Render
source/app/Game/GameState.cpp:17
Method
RenderBoard
Constructor: Loads images and creates textures for the board
source/render/private/RenderBoard.cpp:5
Method
RenderSnake
Constructor: Initializes the RenderSnake with a pointer to a Snake object. Loads the snake body texture from an image file if the Snake pointer is val
source/render/private/RenderSnake.cpp:6
Method
SetHeadPosition
source/core/private/Snake.cpp:19
Method
SetPosition
Sets the position of the food
source/core/private/IFood.cpp:31
Method
Snake
Constructor: Initializes the snake's head position, alive state, direction, and starting tail
source/core/private/Snake.cpp:5
Method
TransformLevelData
Converts the 2D level data into the BoardMap_ structure
source/core/private/Board.cpp:31
Method
Update
source/app/Game/GameState.cpp:24
Function
main
source/app/main.cpp:5
Method
operator()
Vector2Equal: Functor for comparing two Vector2 objects for equality in unordered_map. Compares the integer values of x and y to avoid floating-point
source/core/private/Board.cpp:6
Method
~Button
Destructor: unloads the button texture
source/render/private/Button.cpp:41
Method
~Command
Destructor for the base Command class.
source/core/private/Command.cpp:4
Method
~FoodRender
Destructor: Unloads all loaded textures
source/render/private/RenderFood.cpp:55
Method
~Game
source/app/Game/Game.cpp:203
Method
~GameState
source/app/Game/GameState.cpp:9
Method
~GameUI
Destructor: unloads textures and deletes button objects
source/render/private/GameUI.cpp:97
Method
~IObject
source/core/private/IObject.cpp:13
Method
~InputHandler
* @brief Destructor for InputHandler. */
source/core/public/InputHandler.h:33
Method
~RenderBoard
Destructor: Unloads textures
source/render/private/RenderBoard.cpp:74
Method
~RenderSnake
Destructor: Unloads the snake body texture from GPU memory.
source/render/private/RenderSnake.cpp:153
Method
~Snake
* @brief Destroys the Snake object. */
source/core/public/Snake.h:90