// Autogenerated Go message buffer code.
// Source: clad/gateway/shared.clad
// Full command line: victor-clad/tools/message-buffers/emitters/Go_emitter.py -C src -o generated/cladgo/src clad/gateway/shared.clad

package gateway

import (
  "bytes"
  "encoding/binary"
  "fmt"
)

// STRUCTURE PoseStruct3d
type PoseStruct3d struct {
  X float32
  Y float32
  Z float32
  Q0 float32
  Q1 float32
  Q2 float32
  Q3 float32
  OriginID uint32
}

func (p *PoseStruct3d) Size() uint32 {
  var result uint32
  result += 4 // X float_32
  result += 4 // Y float_32
  result += 4 // Z float_32
  result += 4 // Q0 float_32
  result += 4 // Q1 float_32
  result += 4 // Q2 float_32
  result += 4 // Q3 float_32
  result += 4 // OriginID uint_32
  return result
}

func (p *PoseStruct3d) Unpack(buf *bytes.Buffer) error {
  if err := binary.Read(buf, binary.LittleEndian, &p.X); err != nil {
    return err
  }
  if err := binary.Read(buf, binary.LittleEndian, &p.Y); err != nil {
    return err
  }
  if err := binary.Read(buf, binary.LittleEndian, &p.Z); err != nil {
    return err
  }
  if err := binary.Read(buf, binary.LittleEndian, &p.Q0); err != nil {
    return err
  }
  if err := binary.Read(buf, binary.LittleEndian, &p.Q1); err != nil {
    return err
  }
  if err := binary.Read(buf, binary.LittleEndian, &p.Q2); err != nil {
    return err
  }
  if err := binary.Read(buf, binary.LittleEndian, &p.Q3); err != nil {
    return err
  }
  if err := binary.Read(buf, binary.LittleEndian, &p.OriginID); err != nil {
    return err
  }
  return nil
}

func (p *PoseStruct3d) Pack(buf *bytes.Buffer) error {
  if err := binary.Write(buf, binary.LittleEndian, p.X); err != nil {
    return err
  }
  if err := binary.Write(buf, binary.LittleEndian, p.Y); err != nil {
    return err
  }
  if err := binary.Write(buf, binary.LittleEndian, p.Z); err != nil {
    return err
  }
  if err := binary.Write(buf, binary.LittleEndian, p.Q0); err != nil {
    return err
  }
  if err := binary.Write(buf, binary.LittleEndian, p.Q1); err != nil {
    return err
  }
  if err := binary.Write(buf, binary.LittleEndian, p.Q2); err != nil {
    return err
  }
  if err := binary.Write(buf, binary.LittleEndian, p.Q3); err != nil {
    return err
  }
  if err := binary.Write(buf, binary.LittleEndian, p.OriginID); err != nil {
    return err
  }
  return nil
}

func (p *PoseStruct3d) String() string {
  return fmt.Sprint("X: {", p.X, "} ",
    "Y: {", p.Y, "} ",
    "Z: {", p.Z, "} ",
    "Q0: {", p.Q0, "} ",
    "Q1: {", p.Q1, "} ",
    "Q2: {", p.Q2, "} ",
    "Q3: {", p.Q3, "} ",
    "OriginID: {", p.OriginID, "}")
}


// ENUM ObjectType
type ObjectType int32

const (
  ObjectType_UnknownObject ObjectType = ObjectType(0)                          
  ObjectType_Block_LIGHTCUBE1 ObjectType = ObjectType(1)                       
  ObjectType_Block_LIGHTCUBE2 ObjectType = ObjectType_Block_LIGHTCUBE1 + 1     
  ObjectType_Block_LIGHTCUBE3 ObjectType = ObjectType_Block_LIGHTCUBE2 + 1     
  ObjectType_Block_LIGHTCUBE_GHOST ObjectType = ObjectType_Block_LIGHTCUBE3 + 1
  ObjectType_Charger_Basic ObjectType = ObjectType(5)                          
  ObjectType_CustomType00 ObjectType = ObjectType(14)                          
  ObjectType_CustomType01 ObjectType = ObjectType_CustomType00 + 1             
  ObjectType_CustomType02 ObjectType = ObjectType_CustomType01 + 1             
  ObjectType_CustomType03 ObjectType = ObjectType_CustomType02 + 1             
  ObjectType_CustomType04 ObjectType = ObjectType_CustomType03 + 1             
  ObjectType_CustomType05 ObjectType = ObjectType_CustomType04 + 1             
  ObjectType_CustomType06 ObjectType = ObjectType_CustomType05 + 1             
  ObjectType_CustomType07 ObjectType = ObjectType_CustomType06 + 1             
  ObjectType_CustomType08 ObjectType = ObjectType_CustomType07 + 1             
  ObjectType_CustomType09 ObjectType = ObjectType_CustomType08 + 1             
  ObjectType_CustomType10 ObjectType = ObjectType_CustomType09 + 1             
  ObjectType_CustomType11 ObjectType = ObjectType_CustomType10 + 1             
  ObjectType_CustomType12 ObjectType = ObjectType_CustomType11 + 1             
  ObjectType_CustomType13 ObjectType = ObjectType_CustomType12 + 1             
  ObjectType_CustomType14 ObjectType = ObjectType_CustomType13 + 1             
  ObjectType_CustomType15 ObjectType = ObjectType_CustomType14 + 1             
  ObjectType_CustomType16 ObjectType = ObjectType_CustomType15 + 1             
  ObjectType_CustomType17 ObjectType = ObjectType_CustomType16 + 1             
  ObjectType_CustomType18 ObjectType = ObjectType_CustomType17 + 1             
  ObjectType_CustomType19 ObjectType = ObjectType_CustomType18 + 1             
  ObjectType_CustomFixedObstacle ObjectType = ObjectType_CustomType19 + 1      
)

