1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-07 18:57:18 -05:00
OpenDiablo2/d2common/d2interface/terminal.go

34 lines
1.0 KiB
Go
Raw Normal View History

2020-06-28 21:40:52 -04:00
package d2interface
import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
2020-06-28 21:40:52 -04:00
// Terminal is a drop-down terminal and shell
// It is used throughout the codebase, most parts of the engine will
// `bind` commands, which are available for use in the shell
2020-06-28 21:40:52 -04:00
type Terminal interface {
BindLogger()
Advance(elapsed float64) error
OnKeyDown(event KeyEvent) bool
OnKeyChars(event KeyCharsEvent) bool
Render(surface Surface) error
2020-06-28 21:40:52 -04:00
Execute(command string) error
2020-12-21 15:46:58 -05:00
Rawf(category d2enum.TermCategory, format string, params ...interface{})
Printf(format string, params ...interface{})
Infof(format string, params ...interface{})
Warningf(format string, params ...interface{})
Errorf(format string, params ...interface{})
Clear()
Visible() bool
2020-06-28 21:40:52 -04:00
Hide()
Show()
2020-12-21 15:46:58 -05:00
Bind(name, description string, arguments []string, fn func(args []string) error) error
Unbind(name ...string) error
2020-06-28 21:40:52 -04:00
}
// TerminalLogger is used tomake the Terminal write out
// (eg. to the system shell or to a file)
2020-06-28 21:40:52 -04:00
type TerminalLogger interface {
Write(p []byte) (int, error)
}