func (t *Toon) RegionID() int64 {
	return t.Int("region")
}
RegionID returns the region ID.
package rep
import (
	"fmt"
	"strings"
	"time"
	"github.com/icza/s2prot"
)
type Details struct {
	s2prot.Struct
	players      []Player        
	cacheHandles []*CacheHandle  
}
func (d *Details) Title() string {
	return d.Stringv("title")
}
func (d *Details) IsBlizzardMap() bool {
	return d.Bool("isBlizzardMap")
}
func (d *Details) GameSpeed() *GameSpeed {
	return gameSpeedByID(d.Int("gameSpeed"))
}
func (d *Details) ThumbnailFile() string {
	return d.Stringv("thumbnail", "file")
}
func (d *Details) Time() time.Time {
	return time.Unix(0, (d.Int("timeUTC")-116444736000000000)*100)
}
func (d *Details) TimeUTC() time.Time {
	return time.Unix(0, (d.Int("timeUTC")-116444736000000000-(d.Int("timeLocalOffset")))*100)
}
func (d *Details) TimeLocalOffset() time.Duration {
	return time.Duration(d.Int("timeLocalOffset") * 100)
}
func (d *Details) CacheHandles() []*CacheHandle {
	if d.cacheHandles == nil {
		chs := d.Array("cacheHandles")
		d.cacheHandles = make([]*CacheHandle, len(chs))
		for i, ch := range chs {
			d.cacheHandles[i] = newCacheHandle(ch.(string))
		}
	}
	return d.cacheHandles
}
func (d *Details) CampaignIndex() int64 {
	return d.Int("campaignIndex")
}
func (d *Details) DefaultDifficulty() int64 {
	return d.Int("defaultDifficulty")
}
func (d *Details) Difficulty() int64 {
	return d.Int("difficulty")
}
func (d *Details) Description() string {
	return d.Stringv("description")
}
func (d *Details) ImageFilePath() string {
	return d.Stringv("imageFilePath")
}
func (d *Details) MapFileName() string {
	return d.Stringv("mapFileName")
}
func (d *Details) MiniSave() bool {
	return d.Bool("miniSave")
}
func (d *Details) ModPaths() interface{} {
	return d.Value("modPaths")
}
func (d *Details) RestartAsTransitionMap() bool {
	return d.Bool("restartAsTransitionMap")
}
func (d *Details) Players() []Player {
	if d.players == nil {
		players := d.Array("playerList")
		d.players = make([]Player, len(players))
		for i, pl := range players {
			p := Player{Struct: pl.(s2prot.Struct)}
			p.Name = strings.Replace(p.Stringv("name"), "<sp/>", "", -1)
			p.Toon = Toon{Struct: p.Structv("toon")}
			c := p.Structv("color")
			p.Color = [4]byte{byte(c.Int("a")), byte(c.Int("r")), byte(c.Int("g")), byte(c.Int("b"))}
			d.players[i] = p
		}
	}
	return d.players
}
func (d *Details) Matchup() string {
	m := make([]rune, 0, 9)
	var prevTeamID int64
	for i, p := range d.Players() {
		if i > 0 && p.TeamID() != prevTeamID {
			m = append(m, 'v')
		}
		m = append(m, p.Race().Letter)
		prevTeamID = p.TeamID()
	}
	return string(m)
}
type Player struct {
	s2prot.Struct
	Name  string   
	Toon  Toon     
	Color [4]byte  
	race  *Race    
}
func (p *Player) RaceString() string {
	return p.Stringv("race")
}
func (p *Player) Race() *Race {
	if p.race == nil {
		p.race = raceFromLocalString(p.Stringv("race"))
	}
	return p.race
}
func (p *Player) TeamID() int64 {
	return p.Int("teamId")
}
func (p *Player) Result() *Result {
	return resultByID(p.Int("result"))
}
func (p *Player) Handicap() int64 {
	return p.Int("handicap")
}
func (p *Player) WorkingSetSlotID() int64 {
	return p.Int("workingSetSlotId")
}
func (p *Player) Control() *Control {
	return controlByID(p.Int("control"))
}
func (p *Player) Observe() *Observe {
	return observeByID(p.Int("observe"))
}
func (p *Player) Hero() string {
	return p.Stringv("hero")
}
type Toon struct {
	s2prot.Struct
}
func (t *Toon) ID() int64 {
	return t.Int("id")
}
func (t *Toon) ProgramID() string {
	s := t.Stringv("programId")
	for i := 0; i < len(s); i++ {
		if s[i] != 0 {
			return s[i:]
		}
	}
	return s
}
func (t *Toon) RealmID() int64 {
	return t.Int("realm")
}
func (t *Toon) Realm() *Realm {
	return t.Region().Realm(t.RealmID())
}