app.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. Sokoban, by Racso.
  3. https://rac.so
  4. Licensed under the GNU General Public License v3.0: https://www.gnu.org/licenses/gpl-3.0.en.html
  5. Copyright (C) 2023 Óscar F. Gómez
  6. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. */
  11. #pragma once
  12. #include <gui/gui.h>
  13. typedef struct SceneManager SceneManager;
  14. typedef struct AppGameplayState AppGameplayState;
  15. typedef struct LevelsDatabase LevelsDatabase;
  16. typedef struct AppContext
  17. {
  18. Gui* gui;
  19. SceneManager* sceneManager;
  20. AppGameplayState* gameplay;
  21. LevelsDatabase* database;
  22. } AppContext;
  23. typedef enum SceneType
  24. {
  25. SceneType_None,
  26. SceneType_Menu,
  27. SceneType_Game,
  28. SceneType_Credits,
  29. } SceneType;
  30. typedef struct AppGameplayState
  31. {
  32. int selectedCollection;
  33. int selectedLevel;
  34. } AppGameplayState;
  35. typedef struct LevelItem
  36. {
  37. unsigned short worldBest;
  38. unsigned short playerBest;
  39. } LevelItem;
  40. typedef struct LevelsCollection
  41. {
  42. char name[32];
  43. int levelsCount;
  44. LevelItem* levels;
  45. } LevelsCollection;
  46. typedef struct LevelsDatabase
  47. {
  48. int collectionsCount;
  49. LevelsCollection* collections;
  50. } LevelsDatabase;