-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes coding style + add GameAI lib API header
- Loading branch information
1 parent
59d0d11
commit 93b3aac
Showing
2 changed files
with
40 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <bitset> | ||
#include <string> | ||
#include <filesystem> | ||
#include <vector> | ||
#include <queue> | ||
|
||
typedef void (*debug_log_t)(int level, const char *fmt, ...); | ||
|
||
#define GAMEAI_MAX_BUTTONS 16 | ||
|
||
class GameAI { | ||
public: | ||
virtual void Init(void * ram_ptr, int ram_size) {}; | ||
virtual void Think(bool buttons[GAMEAI_MAX_BUTTONS], int player, const void *frame_data, unsigned int frame_width, unsigned int frame_height, unsigned int frame_pitch, unsigned int pixel_format) {}; | ||
void SetShowDebug(const bool show){ this->showDebug = show; }; | ||
void SetDebugLog(debug_log_t func){debugLogFunc = func;}; | ||
|
||
private: | ||
bool showDebug; | ||
debug_log_t debugLogFunc; | ||
}; | ||
|
||
|
||
typedef GameAI * (*creategameai_t)(const char *); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters