// Code generated by "enumer -type=Rank"; DO NOT EDIT. // package freego import ( "fmt" ) const _RankName = "FlagSpyScoutMinerCaptainGeneralMarshalBombUnknown" var _RankIndex = [...]uint8{0, 4, 7, 12, 17, 24, 31, 38, 42, 49} 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]] } var _RankValues = []Rank{0, 1, 2, 3, 4, 5, 6, 7, 8} 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, _RankName[38:42]: 7, _RankName[42:49]: 8, } // 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 }