controller

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 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
}

Call is an envelope for a GCI call.

func NewCall added in v0.6.0

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

NewCall creates a new Call message.

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

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

New creates a new GCI controller.

func (*Controller) HandleAlphaCheck

func (c *Controller) HandleAlphaCheck(ctx context.Context, request *brevity.AlphaCheckRequest)

HandleAlphaCheck handles an ALPHA CHECK by reporting the position of the requesting aircraft.

func (*Controller) HandleBogeyDope

func (c *Controller) HandleBogeyDope(ctx context.Context, request *brevity.BogeyDopeRequest)

HandleBogeyDope handles a BOGEY DOPE by reporting the closest enemy group to the requesting aircraft.

func (*Controller) HandleCheckIn added in v0.12.0

func (c *Controller) HandleCheckIn(ctx context.Context, request *brevity.CheckInRequest)

HandleCheckIn handles an ambiguous CHECK IN by asking the player to clarify their call.

func (*Controller) HandleDeclare

func (c *Controller) HandleDeclare(ctx context.Context, request *brevity.DeclareRequest)

HandleDeclare handles a DECLARE by reporting information about the target group.

func (*Controller) HandlePicture

func (c *Controller) HandlePicture(ctx context.Context, request *brevity.PictureRequest)

HandlePicture handles a PICTURE by reporting a tactical air picture.

func (*Controller) HandleRadioCheck

func (c *Controller) HandleRadioCheck(ctx context.Context, request *brevity.RadioCheckRequest)

HandleRadioCheck handles a RADIO CHECK by responding to the requesting aircraft.

func (*Controller) HandleShopping added in v0.10.0

func (c *Controller) HandleShopping(ctx context.Context, request *brevity.ShoppingRequest)

HandleShopping handles a SHOPPING request... by not implementing it, since it's not an air-to-air call!

func (*Controller) HandleSnaplock

func (c *Controller) HandleSnaplock(ctx context.Context, request *brevity.SnaplockRequest)

HandleSnaplock handles a SNAPLOCK by reporting information about the target group.

func (*Controller) HandleSpiked

func (c *Controller) HandleSpiked(ctx context.Context, request *brevity.SpikedRequest)

HandleSpiked handles a SPIKED request by reporting any enemy groups in the direction of the radar spike.

func (*Controller) HandleTripwire

func (c *Controller) HandleTripwire(ctx context.Context, request *brevity.TripwireRequest)

HandleTripwire handles a TRIPWIRE... by not implementing it LOL!

func (*Controller) HandleUnableToUnderstand

func (c *Controller) HandleUnableToUnderstand(ctx context.Context, request *brevity.UnableToUnderstandRequest)

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.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, calls chan<- Call)

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.

Jump to

Keyboard shortcuts

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