...

Source file src/github.com/google/flatbuffers/tests/MyGame/Example/Color.go

Documentation: github.com/google/flatbuffers/tests/MyGame/Example

     1  // Code generated by the FlatBuffers compiler. DO NOT EDIT.
     2  
     3  package Example
     4  
     5  import "strconv"
     6  
     7  /// Composite components of Monster color.
     8  type Color byte
     9  
    10  const (
    11  	ColorRed   Color = 1
    12  	/// \brief color Green
    13  	/// Green is bit_flag with value (1u << 1)
    14  	ColorGreen Color = 2
    15  	/// \brief color Blue (1u << 3)
    16  	ColorBlue  Color = 8
    17  )
    18  
    19  var EnumNamesColor = map[Color]string{
    20  	ColorRed:   "Red",
    21  	ColorGreen: "Green",
    22  	ColorBlue:  "Blue",
    23  }
    24  
    25  var EnumValuesColor = map[string]Color{
    26  	"Red":   ColorRed,
    27  	"Green": ColorGreen,
    28  	"Blue":  ColorBlue,
    29  }
    30  
    31  func (v Color) String() string {
    32  	if s, ok := EnumNamesColor[v]; ok {
    33  		return s
    34  	}
    35  	return "Color(" + strconv.FormatInt(int64(v), 10) + ")"
    36  }
    37  

View as plain text