MCPcopy Create free account

hub / github.com/Nazar2347/Snake / functions

Functions99 in github.com/Nazar2347/Snake

↓ 25 callersMethodGetHeadPosition
* @brief Gets the current position of the snake's head. * @return The position of the head. */
source/core/public/Snake.h:42
↓ 18 callersMethodGetPosition
Returns the current position of the food
source/core/private/IFood.cpp:19
↓ 17 callersMethodGetTailPosition
Returns a copy of the current tail positions.
source/core/private/Snake.cpp:14
↓ 16 callersMethodGetCellInfo
Returns the cell type at the given position, or OUT_OF_BORDER if not found
source/core/private/Board.cpp:53
↓ 12 callersMethodSetCellType
Sets the cell type at the given position if it exists
source/core/private/Board.cpp:63
↓ 11 callersMethodChangeTailSizeBy
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 callersMethodSetDirection
Sets the direction of the snake's movement
source/core/private/Snake.cpp:185
↓ 9 callersMethodisAlive
* @brief Checks if the snake is alive. * @return True if the snake is alive, false otherwise. */
source/core/public/Snake.h:63
↓ 8 callersMethodMove
source/core/private/IFood.cpp:57
↓ 7 callersMethodDraw
Draws the button texture at its position
source/render/private/Button.cpp:19
↓ 7 callersMethodGetGameUI
source/app/Game/Game.cpp:211
↓ 6 callersMethodGetFoodType
Returns the type of the food
source/core/private/IFood.cpp:37
↓ 5 callersMethodSetCurrentState
source/app/Game/Game.cpp:216
↓ 4 callersMethodDoSomething
AppleFood does nothing special when activated
source/core/private/IFood.cpp:53
↓ 4 callersMethodDrawBackgorund
Draws background
source/render/private/GameUI.cpp:76
↓ 4 callersMethodGetEmptyCell
Finds and returns the first empty cell position, or {1,1} if none found
source/core/private/Board.cpp:78
↓ 4 callersMethodGetHeadDirection
source/core/public/Snake.h:83
↓ 4 callersMethodGetLevelXSize
Returns the width of the board
source/core/private/Board.cpp:91
↓ 4 callersMethodGetLevelYSize
Returns the height of the board
source/core/private/Board.cpp:97
↓ 4 callersMethodGetRandomValue
source/core/private/Utilities.cpp:8
↓ 3 callersMethodDrawGameUI
source/render/private/GameUI.cpp:28
↓ 3 callersFunctionEmptyLevelData
Helper: Create a simple 3x3 Board1 with all cells empty
tests/TestIFood.cpp:6
↓ 3 callersMethodGetDirection
* @brief Gets the current direction of the snake's head. * @return The current direction. */
source/core/public/Snake.h:78
↓ 3 callersMethodRenderOnPlay
Renders all game components
source/app/Game/Game.cpp:167
↓ 3 callersMethodStartCountingGameScore
source/render/private/GameUI.cpp:55
↓ 3 callersMethodisClicked
Returns true if the button is clicked with the mouse
source/render/private/Button.cpp:25
↓ 2 callersMethodGetPoints
Returns the points value of the food
source/core/private/IFood.cpp:25
↓ 2 callersMethodInitializeLevel
source/app/Game/Game.cpp:75
↓ 2 callersMethodIsRestartButtonClicked
source/render/private/GameUI.cpp:86
↓ 2 callersMethodgetLevelData
Returns the entire board map (positions and their cell types)
source/core/private/Board.cpp:72
↓ 1 callersMethodDrawGameOverLabel
Draws the game over label and restart button
source/render/private/GameUI.cpp:69
↓ 1 callersMethodDrawMenu
Draws the main menu background and buttons
source/render/private/GameUI.cpp:21
↓ 1 callersMethodDrawWinLabel
Draws the win label and restart button
source/render/private/GameUI.cpp:62
↓ 1 callersMethodHandleInput
Checks for key presses and returns the corresponding command object.
source/core/private/InputHandler.cpp:15
↓ 1 callersMethodIsExitButtonClicked
source/render/private/GameUI.cpp:91
↓ 1 callersMethodIsGameOver
Returns true if the snake is dead
source/app/Game/Game.cpp:178
↓ 1 callersMethodIsGameWin
source/app/Game/Game.cpp:221
↓ 1 callersMethodIsLevelCompleted
Returns true if all food has been consumed
source/app/Game/Game.cpp:188
↓ 1 callersMethodIsStartButtonClicked
source/render/private/GameUI.cpp:81
↓ 1 callersMethodProcessInput
source/app/Game/Game.cpp:105
↓ 1 callersMethodProcessInputOnGame
Handles player input and executes commands
source/app/Game/Game.cpp:111
↓ 1 callersMethodRender
source/app/Game/Game.cpp:161
↓ 1 callersMethodUpdate
source/app/Game/Game.cpp:120
↓ 1 callersMethodUpdateOnPlay
Updates game logic: snake movement, food interaction, and level state
source/app/Game/Game.cpp:125
↓ 1 callersMethodexecute
Executes the "move up" command by setting the snake's direction to UP.
source/core/private/Command.cpp:9
MethodAppleFood
AppleFood constructor: sets type to APPLE
source/core/private/IFood.cpp:47
MethodBoard
Constructor: Initializes the board with the given level data
source/core/private/Board.cpp:22
MethodButton
Constructor: loads and resizes the button image, then creates a texture
source/render/private/Button.cpp:4
MethodCheckPosition
source/core/private/IObject.cpp:9
MethodDraw
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
MethodDraw
Draws the given food object using the appropriate texture or a red rectangle if type is unknown
source/render/private/RenderFood.cpp:19
MethodDraw
Draws the board and its cells
source/render/private/RenderBoard.cpp:28
MethodDrawBackground
Draws the background rectangle for the board
source/render/private/RenderBoard.cpp:82
MethodDrawBody
Draws the snake's body segments, choosing the correct texture for straight or turning segments.
source/render/private/RenderSnake.cpp:71
MethodDrawHead
Draws the snake's head using the correct texture based on the current direction.
source/render/private/RenderSnake.cpp:49
MethodDrawSnakePart
Draws a single part of the snake (head, body, or tail) at the specified board position.
source/render/private/RenderSnake.cpp:40
MethodDrawTail
Draws the snake's tail using the correct texture based on the direction of the last segment.
source/render/private/RenderSnake.cpp:119
MethodFoodRender
Constructor: Loads images and creates textures for each food type
source/render/private/RenderFood.cpp:4
MethodFrog
Frog constructor: sets type to FROG and initializes movement
source/core/private/IFood.cpp:63
MethodGame
Constructor: initializes level based on enum
source/app/Game/Game.cpp:65
MethodGameState
source/app/Game/GameState.cpp:6
MethodGameState_Lose
source/app/Game/GameState.cpp:105
MethodGameState_Menu
source/app/Game/GameState.cpp:13
MethodGameState_Play
source/app/Game/GameState.cpp:42
MethodGameState_Win
source/app/Game/GameState.cpp:79
MethodGameUI
Constructor: initializes UI state, loads textures, and creates buttons
source/render/private/GameUI.cpp:5
MethodGetAmountFoodLeft
Returns how many food items are left on the level
source/app/Game/Game.cpp:194
MethodIFood
IFood constructor: initializes food with points, position, and board reference
source/core/private/IFood.cpp:5
MethodIObject
Deleted copy constructor and copy assignment operator
source/core/public/IObject.h:26
MethodIObject
source/core/private/IObject.cpp:4
MethodInitializeLevel1
source/app/Game/Game.cpp:232
MethodInitializeLevel2
source/app/Game/Game.cpp:253
MethodInitializeLevel3
source/app/Game/Game.cpp:275
MethodInputHandler
Constructor: Initializes command objects for each input direction and a null command.
source/core/private/InputHandler.cpp:5
MethodMouse
Mouse constructor: sets type to MOUSE and initializes movement
source/core/private/IFood.cpp:101
MethodMove
Moves the snake in the current direction, updates board and tail positions
source/core/private/Snake.cpp:86
MethodProcessInput
source/app/Game/GameState.cpp:28
MethodRandomNumberGenerator
source/core/private/Utilities.cpp:3
MethodRender
source/app/Game/GameState.cpp:17
MethodRenderBoard
Constructor: Loads images and creates textures for the board
source/render/private/RenderBoard.cpp:5
MethodRenderSnake
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
MethodSetHeadPosition
source/core/private/Snake.cpp:19
MethodSetPosition
Sets the position of the food
source/core/private/IFood.cpp:31
MethodSnake
Constructor: Initializes the snake's head position, alive state, direction, and starting tail
source/core/private/Snake.cpp:5
MethodTransformLevelData
Converts the 2D level data into the BoardMap_ structure
source/core/private/Board.cpp:31
MethodUpdate
source/app/Game/GameState.cpp:24
Functionmain
source/app/main.cpp:5
Methodoperator()
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