connector impl

This commit is contained in:
Ilia Denisov
2026-03-14 21:11:51 +02:00
committed by GitHub
parent c2d2cebe3e
commit ac3ed31a23
9 changed files with 863 additions and 6 deletions
+6
View File
@@ -6,6 +6,7 @@ import (
"os"
"galaxy/model/order"
"galaxy/model/report"
"galaxy/model/rest"
e "galaxy/error"
@@ -21,6 +22,7 @@ type CommandExecutor interface {
GenerateGame([]string) (rest.StateResponse, error)
GenerateTurn() (rest.StateResponse, error)
GameState() (rest.StateResponse, error)
LoadReport(actor string, turn uint) (*report.Report, error)
Execute(cmd ...Command) error
ValidateOrder(actor string, cmd ...order.DecodableCommand) error
}
@@ -84,6 +86,10 @@ func (e *executor) GameState() (rest.StateResponse, error) {
return stateResponse(s), nil
}
func (e *executor) LoadReport(actor string, turn uint) (*report.Report, error) {
return controller.LoadReport(e.cfg, actor, turn)
}
func stateResponse(s game.State) rest.StateResponse {
result := &rest.StateResponse{
ID: s.ID,