state

package
v0.0.0-...-0583f8e Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item uint8
const (
	I1 Item = 0b0000_0001 << iota
	I2
	I3
	I4
	I5
	I6
	I7
	I8
)

type State

type State uint8

State represents the state of the rocket. Each bit of State represent a status (on/off).

func (State) All

func (s State) All() []bool

func (State) I1

func (s State) I1() bool

I1 returns the status (on/off) represented by the rightmost bit

func (State) I2

func (s State) I2() bool

I2 returns the status (on/off) represented by the 2nd rightmost bit

func (State) I3

func (s State) I3() bool

I3 returns the status (on/off) represented by the 3rd rightmost bit

func (State) I4

func (s State) I4() bool

I4 returns the status (on/off) represented by the 4th rightmost bit

func (State) I5

func (s State) I5() bool

I5 returns the status (on/off) represented by the 5th rightmost bit

func (State) I6

func (s State) I6() bool

I6 returns the status (on/off) represented by the 6th rightmost bit

func (State) I7

func (s State) I7() bool

I7 returns the status (on/off) represented by the 7th rightmost bit

func (State) I8

func (s State) I8() bool

I8 returns the status (on/off) represented by the 8th rightmost bit

func (State) StatusOf

func (s State) StatusOf(i Item) bool

func (State) WithI1

func (s State) WithI1(status bool) State

WithI1 returns a copy with I1 set to the specified status

func (State) WithI2

func (s State) WithI2(status bool) State

WithI2 returns a copy with I2 set to the specified status.

func (State) WithI3

func (s State) WithI3(status bool) State

WithI3 returns a copy with I3 set to the specified status.

func (State) WithI4

func (s State) WithI4(status bool) State

WithI4 returns a copy with I4 set to the specified status.

func (State) WithI5

func (s State) WithI5(status bool) State

WithI5 returns a copy with I5 set to the specified status.

func (State) WithI6

func (s State) WithI6(status bool) State

WithI6 returns a copy with I6 set to the specified status.

func (State) WithI7

func (s State) WithI7(status bool) State

WithI7 returns a copy with I7 set to the specified status.

func (State) WithI8

func (s State) WithI8(status bool) State

WithI8 returns a copy with I8 set to the specified status.

func (State) WithStatusOf

func (s State) WithStatusOf(i Item, status bool) State

WithStatusOf returns a copy with the specified item set to the specified status

Jump to

Keyboard shortcuts

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