add Village.FullName method

This commit is contained in:
Dawid Wysokiński 2020-08-09 15:53:00 +02:00
parent 2bc2e8dfde
commit 8ead116529
1 changed files with 9 additions and 1 deletions

View File

@ -23,7 +23,15 @@ func (v *Village) Continent() string {
if v == nil {
return ""
}
return fmt.Sprintf("k%c%c", strconv.FormatInt(int64(v.Y), 10)[0], strconv.FormatInt(int64(v.X), 10)[0])
return fmt.Sprintf("K%c%c", strconv.FormatInt(int64(v.Y), 10)[0], strconv.FormatInt(int64(v.X), 10)[0])
}
func (v *Village) FullName() string {
return fmt.Sprintf("%s (%d|%d) %s",
v.Name,
v.X,
v.Y,
v.Continent())
}
type VillageFilter struct {