port to contact4

This commit is contained in:
Green Sky
2025-03-10 19:45:42 +01:00
parent bdf375a91c
commit 05ccfe918d
6 changed files with 86 additions and 67 deletions

View File

@@ -6,9 +6,14 @@ struct Chess final : public ToxicGameI {
Chess(ToxicGames& tg);
~Chess(void);
// TODO: extract?
struct Coords {
int32_t x {};
int32_t y {};
};
struct ChessCoords {
char L;
uint8_t N;
char L {};
uint8_t N {};
};
struct ChessInstance final : public ToxicGameI::InstanceI {
@@ -30,9 +35,16 @@ struct Chess final : public ToxicGameI {
// ??
//virtual void tick();
private:
bool sendResign(void);
bool sendMove(ChessCoords p0, ChessCoords p1);
//private:
//bool sendResign(void);
//bool sendMove(ChessCoords p0, ChessCoords p1);
// the toxic game stuff
int game_x_left_bound(void);
int game_x_right_bound(void);
int game_y_top_bound(void);
int game_y_bottom_bound(void);
int game_set_window_shape(/*shape*/);
};
uint8_t getGameType(void) const override { return 1; };
@@ -40,7 +52,7 @@ struct Chess final : public ToxicGameI {
std::unique_ptr<InstanceI> createGame(std::vector<uint32_t> with) override;
std::unique_ptr<InstanceI> acceptInvite(uint32_t from, uint32_t game_id) override;
private:
bool sendAcceptInvite(uint32_t to, uint32_t game_id);
//private:
//bool sendAcceptInvite(uint32_t to, uint32_t game_id);
};