enum.go 313 B

1234567891011121314151617181920212223
  1. package static
  2. import "errors"
  3. const (
  4. ANIMS_DANCE = "Dance"
  5. ANIMS_SPEECH = "Speech"
  6. ANIMS_POSE = "Pose"
  7. )
  8. var AnimsTyps = map[string]int{
  9. "Dance": 6,
  10. "Speech": 7,
  11. }
  12. func GetType(code string) (int, error) {
  13. msg, ok := AnimsTyps[code]
  14. if ok {
  15. return msg, nil
  16. }
  17. return 0, errors.New("Unkonw")
  18. }