command

package
v0.0.0-...-7a55708 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAll

func RegisterAll(s *session.Manager)

Types

type AllyAction

type AllyAction string

AllyAction is an Enum for alliance actions.

func (AllyAction) Options

func (AllyAction) Options(src cmd.Source) []string

func (AllyAction) Type

func (AllyAction) Type() string

type Base

type Base struct {
	Name           string
	Description    string
	Aliases        []string
	SubCommands    map[string]SubCommand
	SessionManager *session.Manager
}

Base is a base command that can hold multiple subcommands.

func (*Base) Execute

func (b *Base) Execute(src cmd.Source, args []string)

func (*Base) Run

func (b *Base) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionAlly

type FactionAlly struct {
	Ally          cmd.SubCommand `cmd:"ally"`
	Action        AllyAction     `cmd:"action"`
	TargetFaction string         `cmd:"faction"`
	// contains filtered or unexported fields
}

FactionAlly defines the structure for the /f ally <action> <faction> commands.

func (FactionAlly) Run

func (c FactionAlly) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

Run is executed when a player uses /f ally.

type FactionBorder

type FactionBorder struct {
	Border cmd.SubCommand `cmd:"border"`
	// contains filtered or unexported fields
}

FactionBorder defines the structure for the /f border command.

func (FactionBorder) Run

func (c FactionBorder) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionClaim

type FactionClaim struct {
	Claim cmd.SubCommand `cmd:"claim"`
	// contains filtered or unexported fields
}

FactionClaim defines the structure for the /f claim command.

func (FactionClaim) Run

func (c FactionClaim) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionCreate

type FactionCreate struct {
	Create      cmd.SubCommand `cmd:"create"`
	FactionName string         `cmd:"name"`
	// contains filtered or unexported fields
}

FactionCreate defines the structure for the /f create <name> command.

func (FactionCreate) Run

func (c FactionCreate) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionDelete

type FactionDelete struct {
	Delete      cmd.SubCommand `cmd:"delete"`
	FactionName string         `cmd:"name"`
	// contains filtered or unexported fields
}

FactionDelete defines the structure for the /f delete <name> command.

func (FactionDelete) Run

func (c FactionDelete) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionInfoOther

type FactionInfoOther struct {
	Info        cmd.SubCommand `cmd:"info"`
	FactionName string         `cmd:"name"`
	// contains filtered or unexported fields
}

FactionInfoOther defines the structure for the /f info <name> command.

func (FactionInfoOther) Run

func (c FactionInfoOther) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionInfoSelf

type FactionInfoSelf struct {
	Info cmd.SubCommand `cmd:"info"`
	// contains filtered or unexported fields
}

FactionInfoSelf defines the structure for the /f info command (no arguments).

func (FactionInfoSelf) Run

func (c FactionInfoSelf) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionInvite

type FactionInvite struct {
	Invite cmd.SubCommand `cmd:"invite"`
	Target []cmd.Target   `cmd:"player"`
	// contains filtered or unexported fields
}

FactionInvite defines the structure for the /f invite <player> command.

func (FactionInvite) Run

func (c FactionInvite) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionJoin

type FactionJoin struct {
	Join        cmd.SubCommand `cmd:"join"`
	FactionName string         `cmd:"faction"`
	// contains filtered or unexported fields
}

FactionJoin defines the structure for the /f join <faction> command.

func (FactionJoin) Run

func (c FactionJoin) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionLeave

type FactionLeave struct {
	Leave cmd.SubCommand `cmd:"leave"`
	// contains filtered or unexported fields
}

FactionLeave defines the structure for the /f leave command.

func (FactionLeave) Run

func (c FactionLeave) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionTop

type FactionTop struct {
	Top      cmd.SubCommand `cmd:"top"`
	Category TopType        `cmd:"category"`
	// contains filtered or unexported fields
}

FactionTop defines the structure for the /f top <player|faction> command.

func (FactionTop) Run

func (c FactionTop) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type FactionUnclaim

type FactionUnclaim struct {
	Unclaim cmd.SubCommand `cmd:"unclaim"`
	// contains filtered or unexported fields
}

FactionUnclaim defines the structure for the /f unclaim command.

func (FactionUnclaim) Run

func (c FactionUnclaim) Run(src cmd.Source, o *cmd.Output, tx *world.Tx)

type SubCommand

type SubCommand interface {
	// Name is the name of the subcommand (e.g., "create", "invite").
	Name() string
	// Execute is the function called when a player uses the subcommand.
	Execute(p *player.Player, args []string, s *session.Manager)
}

SubCommand defines the structure that all of our subcommands must have.

type TopType

type TopType string

TopType is an Enum for the player to choose which ranking to view.

func (TopType) Options

func (TopType) Options(src cmd.Source) []string

Options returns the valid options for the Enum.

func (TopType) Type

func (TopType) Type() string

Type returns the name of the Enum type.

Jump to

Keyboard shortcuts

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