1 #ifndef FRUITMANAGER_H_DEFINED 2 #define FRUITMANAGER_H_DEFINED 4 #include <Game/Player.hpp> 5 #include <Game/Board.hpp> 6 #include <Interface/Window.hpp> 48 void add(
int x,
int y);
59 std::vector<Fruit> fruit;
63 #endif //FRUITMANAGER_H_DEFINED void add(int x, int y)
Creates a fruit, adding it at #x, #y.
bool eatenFruit(Player *player)
Tells if the #player has eaten a fruit this frame.
A segment of the terminal screen (2D char matrix).
Controls how many Fruits are there and how they're spawned.
void update(Player *player, Board *board)
Updates internal fruits, adding them to the #board and making sure it doesn't touch #player...
A level where the snake runs and eats fruits.
int getAmount()
Returns the maximum size we can store within this manager.
void addRandomly(Board *board, Player *player)
Creates a fruit randomly within boundaries of #board, making sure that it's not inside #player...
FruitManager(int amount)
Creates a Fruit container that has at most #amount fruits at once on the screen.