Skip to content

Creating a custom component

kevin faust edited this page Jul 27, 2015 · 1 revision

Creating a new component is fairly easy in Text Electronics. You just need to create two structs implementing the Recognizer interface and the Component interface respectively.

Let's tackle the Component implementation first. Let's take a look at the Component interface first for reference.

type Component interface {
    Id() string
    Space() (int, int, int, int)
    Update()
    Print()
    Connect(*int, string)
    Output(string) *int
    InputStreams() []string
    OutputStreams() []string
    Visual() map[Coordinate]*int
}
Clone this wiki locally