format

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format[T gcers.Enumer] struct {
	// contains filtered or unexported fields
}

Format is a type that represents a format.

func NewFormat

func NewFormat[T gcers.Enumer]() *Format[T]

NewFormat returns a new format.

Returns:

  • *Format: The new format.

func (*Format[T]) AddElement

func (f *Format[T]) AddElement(key T, elem dtb.Displayer)

AddElement adds an element to the format.

Parameters:

  • key: The key of the element.
  • elem: The element to add.

func (*Format[T]) Draw

func (f *Format[T]) Draw(table *dtb.Table, x, y *int) error

Draw implements the drawtable.Displayer interface.

func (*Format[T]) GetElement

func (f *Format[T]) GetElement(key T) (dtb.Displayer, bool)

GetElement returns an element from the format.

Parameters:

  • key: The key of the element.

Returns:

  • Displayer: The element.
  • bool: True if the element exists, false otherwise.

func (*Format[T]) GetOrder

func (f *Format[T]) GetOrder() []T

GetOrder returns the order of the elements.

Returns:

  • []T: The order of the elements.

func (*Format[T]) RemoveElement

func (f *Format[T]) RemoveElement(key T)

RemoveElement removes an element from the format.

Parameters:

  • key: The key of the element.

func (*Format[T]) ReplaceElement

func (f *Format[T]) ReplaceElement(key T, elem dtb.Displayer)

ReplaceElement replaces an element in the format.

Parameters:

  • key: The key of the element.
  • elem: The element to replace the existing element with.

type ZeroElement

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

ZeroElement is a type that represents an element that takes up a certain amount of space.

func NewZeroElement

func NewZeroElement(width, height int) *ZeroElement

NewZeroElement creates a new ZeroElement with the given width and height.

Parameters:

  • width: The width of the element.
  • height: The height of the element.

Returns:

  • *ZeroElement: The new ZeroElement.

func (*ZeroElement) Draw

func (ze *ZeroElement) Draw(table *dtb.Table, x, y *int) error

Draw implements the drawtable.Displayer interface.

Jump to

Keyboard shortcuts

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