Added comments to Control Character. Fixes #8
This commit is contained in:
parent
b8b1e0ca05
commit
5f0aaa4947
1 changed files with 11 additions and 0 deletions
|
@ -2,11 +2,18 @@ package feragstring
|
|||
|
||||
import "fmt"
|
||||
|
||||
// ControlCharacterSet is a struct for the control character
|
||||
// field in the FERAG messages that support control characters
|
||||
// (Route Info, Production Drop).
|
||||
// Supports currently only "D" (Don't Produce) and "T" (Bundles
|
||||
// to Secondary Exit).
|
||||
type ControlCharacterSet struct {
|
||||
DontProduce bool
|
||||
BundlesToSecondaryExit bool
|
||||
}
|
||||
|
||||
// NewControlCharacterSet instantiates a new Control Character Set
|
||||
// struct and returns a pointer to it.
|
||||
func NewControlCharacterSet() *ControlCharacterSet {
|
||||
cc := ControlCharacterSet{
|
||||
DontProduce: false,
|
||||
|
@ -15,14 +22,18 @@ func NewControlCharacterSet() *ControlCharacterSet {
|
|||
return &cc
|
||||
}
|
||||
|
||||
// SetDontProduce sets the "don't produce" flag (D)
|
||||
func (cc *ControlCharacterSet) SetDontProduce() {
|
||||
cc.DontProduce = true
|
||||
}
|
||||
|
||||
// SetBundlesToSecondaryExit sets the "bundles to secondary exit" flag (T)
|
||||
func (cc *ControlCharacterSet) SetBundlesToSecondaryExit() {
|
||||
cc.BundlesToSecondaryExit = true
|
||||
}
|
||||
|
||||
// GetControlCharactersMessage returns the formatted FERAG string for
|
||||
// the control character set.
|
||||
func (cc *ControlCharacterSet) GetControlCharactersMessage() string {
|
||||
var ccCount int
|
||||
var ccString string
|
||||
|
|
Loading…
Reference in a new issue