2021-10-11 18:11:48 +00:00
|
|
|
// Copyright (c) Jon Thysell <http://jonthysell.com>
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
|
|
#ifndef GAMEENGINE_H
|
|
|
|
#define GAMEENGINE_H
|
|
|
|
|
|
|
|
#include "Levels.h"
|
|
|
|
|
|
|
|
extern const int8_t PuzzleSize;
|
|
|
|
|
|
|
|
extern const uint8_t MaxStars;
|
|
|
|
extern const uint8_t MaxHalfStars;
|
|
|
|
extern const uint8_t MinHalfStars;
|
|
|
|
|
|
|
|
extern const uint16_t PerfectScore;
|
|
|
|
|
|
|
|
typedef struct GameEngine
|
|
|
|
{
|
2021-10-29 00:44:36 +00:00
|
|
|
uint16_t Score;
|
2021-10-16 00:29:07 +00:00
|
|
|
int8_t Level;
|
2021-10-22 18:32:19 +00:00
|
|
|
bool SetB;
|
2021-10-11 18:11:48 +00:00
|
|
|
uint32_t Lights;
|
|
|
|
uint16_t Par;
|
|
|
|
uint16_t Moves;
|
|
|
|
} GameEngine;
|
|
|
|
|
2021-10-29 00:44:36 +00:00
|
|
|
void GameEngine_NewGame(GameEngine *pGameEngine, const bool setB);
|
|
|
|
|
|
|
|
void GameEngine_NextLevel(GameEngine *pGameEngine);
|
|
|
|
|
|
|
|
void GameEngine_ResetLevel(GameEngine *pGameEngine);
|
2021-10-11 18:11:48 +00:00
|
|
|
|
2021-10-16 00:29:07 +00:00
|
|
|
bool GameEngine_GetLight(const GameEngine *pGameEngine, const int8_t x, const int8_t y);
|
2021-10-11 18:11:48 +00:00
|
|
|
|
2021-10-16 00:29:07 +00:00
|
|
|
bool GameEngine_IsCompleted(const GameEngine *pGameEngine);
|
2021-10-11 18:11:48 +00:00
|
|
|
|
2021-10-31 22:13:51 +00:00
|
|
|
bool GameEngine_IsGameOver(const GameEngine *pGameEngine);
|
|
|
|
|
2021-10-16 00:29:07 +00:00
|
|
|
uint8_t GameEngine_GetHalfStars(const GameEngine *pGameEngine);
|
2021-10-11 18:11:48 +00:00
|
|
|
|
2021-10-16 00:29:07 +00:00
|
|
|
void GameEngine_ToggleLights(GameEngine *pGameEngine, const int8_t x, const int8_t y);
|
2021-10-11 18:11:48 +00:00
|
|
|
|
|
|
|
#endif
|