github.com/df-mc/dragonfly@v0.9.13/server/world/sound/goat_horn.go (about)

     1  package sound
     2  
     3  // Horn represents a variant of a goat horn.
     4  type Horn struct {
     5  	goatHornType
     6  }
     7  
     8  // Ponder returns the 'Ponder' goat horn type.
     9  func Ponder() Horn {
    10  	return Horn{0}
    11  }
    12  
    13  // Sing returns the 'Sing' goat horn type.
    14  func Sing() Horn {
    15  	return Horn{1}
    16  }
    17  
    18  // Seek returns the 'Seek' goat horn type.
    19  func Seek() Horn {
    20  	return Horn{2}
    21  }
    22  
    23  // Feel returns the 'Feel' goat horn type.
    24  func Feel() Horn {
    25  	return Horn{3}
    26  }
    27  
    28  // Admire returns the 'Admire' goat horn type.
    29  func Admire() Horn {
    30  	return Horn{4}
    31  }
    32  
    33  // Call returns the 'Call' goat horn type.
    34  func Call() Horn {
    35  	return Horn{5}
    36  }
    37  
    38  // Yearn returns the 'Yearn' goat horn type.
    39  func Yearn() Horn {
    40  	return Horn{6}
    41  }
    42  
    43  // Dream returns the 'Dream' goat horn type.
    44  func Dream() Horn {
    45  	return Horn{7}
    46  }
    47  
    48  type goatHornType uint8
    49  
    50  // Uint8 returns the goat horn type as a uint8.
    51  func (g goatHornType) Uint8() uint8 {
    52  	return uint8(g)
    53  }
    54  
    55  // Name returns the goat horn type's name.
    56  func (g goatHornType) Name() string {
    57  	switch g {
    58  	case 0:
    59  		return "Ponder"
    60  	case 1:
    61  		return "Sing"
    62  	case 2:
    63  		return "Seek"
    64  	case 3:
    65  		return "Feel"
    66  	case 4:
    67  		return "Admire"
    68  	case 5:
    69  		return "Call"
    70  	case 6:
    71  		return "Yearn"
    72  	case 7:
    73  		return "Dream"
    74  	}
    75  	panic("should never happen")
    76  }
    77  
    78  // GoatHorns ...
    79  func GoatHorns() []Horn {
    80  	return []Horn{Ponder(), Sing(), Seek(), Feel(), Admire(), Call(), Yearn(), Dream()}
    81  }