Documentation
¶
Index ¶
- type ActionLogEntry
- type GameClientProvider
- type Member
- type Order
- type OrderQueue
- type StatusReport
- type Team
- type TeamCoordinator
- func (tc *TeamCoordinator) AddTeam(t Team)
- func (tc *TeamCoordinator) CollectStatusReports(_ context.Context)
- func (tc *TeamCoordinator) GetActionLog(teamID string, limit int) []ActionLogEntry
- func (tc *TeamCoordinator) GetOrderQueue(agentID string) *OrderQueue
- func (tc *TeamCoordinator) GetStatusReport(agentID string) *StatusReport
- func (tc *TeamCoordinator) GetTeam(teamID string) *Team
- func (tc *TeamCoordinator) GetTeamStatus(teamID string) []StatusReport
- func (tc *TeamCoordinator) IssueOrder(teamID string, order Order) error
- func (tc *TeamCoordinator) ListTeams() []Team
- func (tc *TeamCoordinator) LogAction(teamID, agentID, action, status string)
- func (tc *TeamCoordinator) RemoveTeam(teamID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionLogEntry ¶
type ActionLogEntry struct {
Timestamp time.Time `json:"timestamp"`
TeamID string `json:"team_id"`
AgentID string `json:"agent_id"`
Action string `json:"action"`
Status string `json:"status"`
}
ActionLogEntry records a team action for the combined log.
type GameClientProvider ¶
GameClientProvider returns a game client for the given agent ID.
type Member ¶
type Member struct {
AgentID string `json:"agent_id"`
Role string `json:"role"`
Strategy string `json:"strategy,omitempty"`
}
Member represents a single agent within a team.
type Order ¶
type Order struct {
ID string `json:"id"`
Type string `json:"type"` // "move", "attack", "dock", "mine", "regroup"
Target string `json:"target"`
Priority int `json:"priority"`
IssuedBy string `json:"issued_by"`
ExpiresAt time.Time `json:"expires_at"`
}
Order represents a command issued by a team leader.
type OrderQueue ¶
type OrderQueue struct {
// contains filtered or unexported fields
}
OrderQueue is a thread-safe queue of orders for a team member.
func (*OrderQueue) Pop ¶
func (q *OrderQueue) Pop() *Order
Pop returns and removes the highest priority pending order, or nil if empty.
type StatusReport ¶
type StatusReport struct {
AgentID string `json:"agent_id"`
System string `json:"system"`
POI string `json:"poi"`
CurrentAction string `json:"current_action"`
Docked bool `json:"docked"`
InCombat bool `json:"in_combat"`
Hull float64 `json:"hull"`
Fuel float64 `json:"fuel"`
Credits float64 `json:"credits"`
CargoUsed float64 `json:"cargo_used"`
CargoCapacity float64 `json:"cargo_capacity"`
Timestamp time.Time `json:"timestamp"`
}
StatusReport is a snapshot of a member's current state.
type Team ¶
type Team struct {
ID string `json:"id"`
Name string `json:"name"`
LeaderID string `json:"leader_id"`
Members []Member `json:"members"`
}
Team represents a coordinated group of agents.
type TeamCoordinator ¶
type TeamCoordinator struct {
// contains filtered or unexported fields
}
TeamCoordinator manages all teams, collects status reports, and dispatches orders.
func NewCoordinator ¶
func NewCoordinator(clientProvider GameClientProvider, logger *log.Logger) *TeamCoordinator
NewCoordinator creates a new team coordinator.
func (*TeamCoordinator) AddTeam ¶
func (tc *TeamCoordinator) AddTeam(t Team)
AddTeam registers a team with the coordinator.
func (*TeamCoordinator) CollectStatusReports ¶
func (tc *TeamCoordinator) CollectStatusReports(_ context.Context)
CollectStatusReports gathers status reports from all team members.
func (*TeamCoordinator) GetActionLog ¶
func (tc *TeamCoordinator) GetActionLog(teamID string, limit int) []ActionLogEntry
GetActionLog returns recent action log entries for a team.
func (*TeamCoordinator) GetOrderQueue ¶
func (tc *TeamCoordinator) GetOrderQueue(agentID string) *OrderQueue
GetOrderQueue returns the order queue for an agent.
func (*TeamCoordinator) GetStatusReport ¶
func (tc *TeamCoordinator) GetStatusReport(agentID string) *StatusReport
GetStatusReport returns the latest status report for an agent.
func (*TeamCoordinator) GetTeam ¶
func (tc *TeamCoordinator) GetTeam(teamID string) *Team
GetTeam returns a team by ID.
func (*TeamCoordinator) GetTeamStatus ¶
func (tc *TeamCoordinator) GetTeamStatus(teamID string) []StatusReport
GetTeamStatus returns status reports for all members of a team.
func (*TeamCoordinator) IssueOrder ¶
func (tc *TeamCoordinator) IssueOrder(teamID string, order Order) error
IssueOrder dispatches an order to all members of a team (or a specific member).
func (*TeamCoordinator) ListTeams ¶
func (tc *TeamCoordinator) ListTeams() []Team
ListTeams returns all registered teams.
func (*TeamCoordinator) LogAction ¶
func (tc *TeamCoordinator) LogAction(teamID, agentID, action, status string)
LogAction records an action in the team log.
func (*TeamCoordinator) RemoveTeam ¶
func (tc *TeamCoordinator) RemoveTeam(teamID string) error
RemoveTeam removes a team from the coordinator.