Skip to content

Commit 1956d08

Browse files
authored
Add GetOpenGames (#13)
Expose GetOpenGames and GetOpenGamesResponse.
1 parent fca26b3 commit 1956d08

9 files changed

Lines changed: 544 additions & 39 deletions

File tree

go/connectfour/v1/gamingplatform.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ package connectfourv1
55
const GameType = "ConnectFour.Game.v1"
66
const GetGamesByPlayerType = "ConnectFour.GetGamesByPlayer.v1"
77
const GetGamesByPlayerResponseType = "ConnectFour.GetGamesByPlayerResponse.v1"
8+
const GetOpenGamesType = "ConnectFour.GetOpenGames.v1"
9+
const GetOpenGamesResponseType = "ConnectFour.GetOpenGamesResponse.v1"
810
const JoinGameType = "ConnectFour.JoinGame.v1"
911
const JoinGameResponseType = "ConnectFour.JoinGameResponse.v1"
1012
const MakeMoveType = "ConnectFour.MakeMove.v1"

go/connectfour/v1/messaging.pb.go

Lines changed: 208 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,35 @@ public static function createGetGamesByPlayerResponse(
4747
if ($data !== null) $message->mergeFromString($data);
4848
return $message;
4949
}
50+
public const string GetOpenGamesType = 'ConnectFour.GetOpenGames.v1';
51+
public static function createGetOpenGames(
52+
?string $data = null
53+
): GetOpenGames {
54+
static $template;
55+
$template ??= new GetOpenGames();
56+
$message = clone $template;
57+
if ($data !== null) $message->mergeFromString($data);
58+
return $message;
59+
}
60+
public static function createGetOpenGamesResponse_Game(
61+
?string $data = null
62+
): GetOpenGamesResponse\Game {
63+
static $template;
64+
$template ??= new GetOpenGamesResponse\Game();
65+
$message = clone $template;
66+
if ($data !== null) $message->mergeFromString($data);
67+
return $message;
68+
}
69+
public const string GetOpenGamesResponseType = 'ConnectFour.GetOpenGamesResponse.v1';
70+
public static function createGetOpenGamesResponse(
71+
?string $data = null
72+
): GetOpenGamesResponse {
73+
static $template;
74+
$template ??= new GetOpenGamesResponse();
75+
$message = clone $template;
76+
if ($data !== null) $message->mergeFromString($data);
77+
return $message;
78+
}
5079
public const string JoinGameType = 'ConnectFour.JoinGame.v1';
5180
public static function createJoinGame(
5281
?string $data = null

php/GamingPlatform/Api/ConnectFour/V1/ConnectFourV1Factory.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,39 @@ public static function createGetGamesByPlayerResponse(
5353
return $message;
5454
}
5555

56+
/** @deprecated */
57+
public static function createGetOpenGames(
58+
string $data
59+
): \GamingPlatform\Api\ConnectFour\V1\GetOpenGames {
60+
static $template;
61+
$template ??= new \GamingPlatform\Api\ConnectFour\V1\GetOpenGames();
62+
$message = clone $template;
63+
$message->mergeFromString($data);
64+
return $message;
65+
}
66+
67+
/** @deprecated */
68+
public static function createGetOpenGamesResponse_Game(
69+
string $data
70+
): \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse\Game {
71+
static $template;
72+
$template ??= new \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse\Game();
73+
$message = clone $template;
74+
$message->mergeFromString($data);
75+
return $message;
76+
}
77+
78+
/** @deprecated */
79+
public static function createGetOpenGamesResponse(
80+
string $data
81+
): \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse {
82+
static $template;
83+
$template ??= new \GamingPlatform\Api\ConnectFour\V1\GetOpenGamesResponse();
84+
$message = clone $template;
85+
$message->mergeFromString($data);
86+
return $message;
87+
}
88+
5689
/** @deprecated */
5790
public static function createJoinGame(
5891
string $data

php/GamingPlatform/Api/ConnectFour/V1/GetOpenGames.php

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

php/GamingPlatform/Api/ConnectFour/V1/GetOpenGamesResponse.php

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

php/GamingPlatform/Api/ConnectFour/V1/GetOpenGamesResponse/Game.php

Lines changed: 142 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
208 Bytes
Binary file not shown.

schema/gamingplatform/api/connectfour/v1/messaging.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ message MakeMove {
4141
message MakeMoveResponse {
4242
}
4343

44+
message GetOpenGames {
45+
int32 limit = 1;
46+
}
47+
48+
message GetOpenGamesResponse {
49+
message Game {
50+
string game_id = 1;
51+
int32 width = 2;
52+
int32 height = 3;
53+
string player_id = 4;
54+
}
55+
repeated Game games = 1;
56+
}
57+
4458
message GetGamesByPlayer {
4559
enum State {
4660
STATE_UNSPECIFIED = 0;

0 commit comments

Comments
 (0)