team

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

type GameClientProvider func(agentID string) *game.Client

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 NewOrderQueue

func NewOrderQueue() *OrderQueue

NewOrderQueue creates an empty order queue.

func (*OrderQueue) Len

func (q *OrderQueue) Len() int

Len returns the number of pending orders.

func (*OrderQueue) Pop

func (q *OrderQueue) Pop() *Order

Pop returns and removes the highest priority pending order, or nil if empty.

func (*OrderQueue) Push

func (q *OrderQueue) Push(o Order)

Push adds an order to the queue.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL