2022-02-20 17:10:50 -05:00
|
|
|
// Code generated by "enumer -type=Rank"; DO NOT EDIT.
|
|
|
|
|
|
|
|
//
|
2022-02-21 19:07:28 -05:00
|
|
|
package freego
|
2022-02-20 17:10:50 -05:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2022-02-20 18:36:52 -05:00
|
|
|
const _RankName = "FlagSpyScoutMinerCaptainGeneralMarshalBomb"
|
2022-02-20 17:10:50 -05:00
|
|
|
|
2022-02-20 18:36:52 -05:00
|
|
|
var _RankIndex = [...]uint8{0, 4, 7, 12, 17, 24, 31, 38, 42}
|
2022-02-20 17:10:50 -05:00
|
|
|
|
|
|
|
func (i Rank) String() string {
|
|
|
|
if i < 0 || i >= Rank(len(_RankIndex)-1) {
|
|
|
|
return fmt.Sprintf("Rank(%d)", i)
|
|
|
|
}
|
|
|
|
return _RankName[_RankIndex[i]:_RankIndex[i+1]]
|
|
|
|
}
|
|
|
|
|
2022-02-20 18:36:52 -05:00
|
|
|
var _RankValues = []Rank{0, 1, 2, 3, 4, 5, 6, 7}
|
2022-02-20 17:10:50 -05:00
|
|
|
|
|
|
|
var _RankNameToValueMap = map[string]Rank{
|
|
|
|
_RankName[0:4]: 0,
|
|
|
|
_RankName[4:7]: 1,
|
|
|
|
_RankName[7:12]: 2,
|
|
|
|
_RankName[12:17]: 3,
|
|
|
|
_RankName[17:24]: 4,
|
|
|
|
_RankName[24:31]: 5,
|
|
|
|
_RankName[31:38]: 6,
|
2022-02-20 18:36:52 -05:00
|
|
|
_RankName[38:42]: 7,
|
2022-02-20 17:10:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// RankString retrieves an enum value from the enum constants string name.
|
|
|
|
// Throws an error if the param is not part of the enum.
|
|
|
|
func RankString(s string) (Rank, error) {
|
|
|
|
if val, ok := _RankNameToValueMap[s]; ok {
|
|
|
|
return val, nil
|
|
|
|
}
|
|
|
|
return 0, fmt.Errorf("%s does not belong to Rank values", s)
|
|
|
|
}
|
|
|
|
|
|
|
|
// RankValues returns all values of the enum
|
|
|
|
func RankValues() []Rank {
|
|
|
|
return _RankValues
|
|
|
|
}
|
|
|
|
|
|
|
|
// IsARank returns "true" if the value is listed in the enum definition. "false" otherwise
|
|
|
|
func (i Rank) IsARank() bool {
|
|
|
|
for _, v := range _RankValues {
|
|
|
|
if i == v {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|