controller

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

package controller implements high-level logic for Ground-Controlled Interception (GCI)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Call added in v0.6.0

type Call struct {
	Context context.Context
	Call    any
}

func NewCall added in v0.6.0

func NewCall(ctx context.Context, call any) Call

type Controller

type Controller interface {
	// Run starts the controller's control loops. It should be called exactly once. It blocks until the context is canceled.
	// The controller publishes responses to the given channel.
	Run(ctx context.Context, out chan<- Call)
	// HandleAlphaCheck handles an ALPHA CHECK by reporting the position of the requesting aircraft.
	HandleAlphaCheck(context.Context, *brevity.AlphaCheckRequest)
	// HandleBogeyDope handles a BOGEY DOPE by reporting the closest enemy group to the requesting aircraft.
	HandleBogeyDope(context.Context, *brevity.BogeyDopeRequest)
	// HandleCheckIn handles an ambiguous CHECK IN by asking the player to clarify their call.
	HandleCheckIn(context.Context, *brevity.CheckInRequest)
	// HandleDeclare handles a DECLARE by reporting information about the target group.
	HandleDeclare(context.Context, *brevity.DeclareRequest)
	// HandlePicture handles a PICTURE by reporting a tactical air picture.
	HandlePicture(context.Context, *brevity.PictureRequest)
	// HandleRadioCheck handles a RADIO CHECK by responding to the requesting aircraft.
	HandleRadioCheck(context.Context, *brevity.RadioCheckRequest)
	// HandleShopping handles a SHOPPING request... by not implementing it, since it's not an air-to-air call!
	HandleShopping(context.Context, *brevity.ShoppingRequest)
	// HandleSnaplock handles a SNAPLOCK by reporting information about the target group.
	HandleSnaplock(context.Context, *brevity.SnaplockRequest)
	// HandleSpiked handles a SPIKED by reporting any enemy groups in the direction of the radar spike.
	HandleSpiked(context.Context, *brevity.SpikedRequest)
	// HandleTripwire handles a TRIPWIRE... by not implementing it LOL
	HandleTripwire(context.Context, *brevity.TripwireRequest)
	// HandleUnableToUnderstand handles requests where the wake word was recognized but the request could not be understood, by asking players on the channel to repeat their message.
	HandleUnableToUnderstand(context.Context, *brevity.UnableToUnderstandRequest)
}

Controller handles requests for GCI service.

func New

func New(
	rdr radar.Radar,
	srsClient simpleradio.Client,
	coalition coalitions.Coalition,
	enableAutomaticPicture bool,
	pictureBroadcastInterval time.Duration,
	enableThreatMonitoring bool,
	threatMonitoringCooldown time.Duration,
	threatMonitoringRequiresSRS bool,
) Controller

Jump to

Keyboard shortcuts

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