Documentation
¶
Index ¶
- func Display(room *rooms.Room, game def.GameCtrl, message *m.Message) bool
- func Look(room *rooms.Room, game def.GameCtrl, message *messages.Message) bool
- type Command
- type CommandKey
- type CommandProcessor
- type ExactCommandKey
- type HelpCommand
- type InventoryCommand
- type ListCharactersCommand
- type NewCharacterCommand
- type RoomCommand
- type RoomProcessor
- type ScreamCommand
- type SelectCharacterCommand
- type ShrugCommand
- type StartsWithCommandKey
- type WhoCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command interface { Execute(game def.GameCtrl, message *messages.Message) bool Key() CommandKey }
Command ... commands
Commands are usually parsed from player input or sent from other actions, commands usually trigger an immediate result to the originator, the room or another player. Commands can also invoke system messages that lead to other events or commands
type CommandKey ¶
CommandKey is used to differentiate between commands that have parameters or comands (with single or multiple words) without parameters
type CommandProcessor ¶
CommandProcessor ... global user struct to control logins
func NewCommandProcessor ¶
func NewCommandProcessor() *CommandProcessor
NewCommandProcessor .. creates a new command processor
func (*CommandProcessor) Process ¶
func (commandProcessor *CommandProcessor) Process(game def.GameCtrl, message *messages.Message) bool
Process ...asd
func (*CommandProcessor) RegisterCommand ¶
func (commandProcessor *CommandProcessor) RegisterCommand(command Command, desc string, keys ...string)
RegisterCommand ... register
type HelpCommand ¶
type HelpCommand struct {
// contains filtered or unexported fields
}
HelpCommand ... foo
type InventoryCommand ¶
type InventoryCommand struct {
// contains filtered or unexported fields
}
InventoryCommand ... foo
type ListCharactersCommand ¶
type ListCharactersCommand struct { }
ListCharactersCommand ... foo
type NewCharacterCommand ¶
type NewCharacterCommand struct { }
NewCharacterCommand ...
type RoomCommand ¶
RoomCommand ...
type RoomProcessor ¶
type RoomProcessor struct {
// contains filtered or unexported fields
}
RoomProcessor ... handles room based commands
func NewRoomProcessor ¶
func NewRoomProcessor() *RoomProcessor
NewRoomProcessor .. creates a new room processor
func (*RoomProcessor) RegisterCommand ¶
func (roomProcessor *RoomProcessor) RegisterCommand(command RoomCommand, keys ...string)
RegisterCommand ... register
type ScreamCommand ¶
type ScreamCommand struct { }
ScreamCommand ... foo
type SelectCharacterCommand ¶
type SelectCharacterCommand struct { }
SelectCharacterCommand ... select a character
func (*SelectCharacterCommand) Key ¶
func (command *SelectCharacterCommand) Key() CommandKey
Key ...
type ShrugCommand ¶
type ShrugCommand struct { }
ShrugCommand ... foo
type WhoCommand ¶
type WhoCommand struct { }
WhoCommand ... foo