Example #1
0
func (self *HTTPContext) ChatFlagMap() string {
	return gosubs.Prettify(map[string]int{
		"ChatPrivate":    ChatPrivate,
		"ChatGroup":      ChatGroup,
		"ChatConference": ChatConference,
	})
}
Example #2
0
func (self *HTTPContext) SecretFlagMap() string {
	return gosubs.Prettify(map[string]int{
		"BeforeGame": SecretBeforeGame,
		"DuringGame": SecretDuringGame,
		"AfterGame":  SecretAfterGame,
	})
}
Example #3
0
func (self *HTTPContext) SecrecyTypesMap() string {
	return gosubs.Prettify(map[string]string{
		"SecretEmail":    self.mI("Secret email"),
		"SecretNickname": self.mI("Secret nickname"),
		"SecretNation":   self.mI("Secret nation"),
	})
}
Example #4
0
func (self *HTTPContext) ConsequenceMap() string {
	return gosubs.Prettify(map[string]Consequence{
		"ReliabilityHit": ReliabilityHit,
		"NoWait":         NoWait,
		"Surrender":      Surrender,
	})
}
Example #5
0
func (self *HTTPContext) VariantMap() string {
	result := map[string]Variant{}
	for _, variant := range Variants {
		variant.Translation = self.mI(variant.Name)
		result[variant.Id] = variant
	}
	return gosubs.Prettify(result)
}
Example #6
0
func (self *HTTPContext) Variants() string {
	result := sort.StringSlice{}
	for _, variant := range Variants {
		result = append(result, variant.Id)
	}
	sort.Sort(result)
	return gosubs.Prettify(result)
}
Example #7
0
func (self *HTTPContext) AllocationMethods() string {
	result := sort.StringSlice{}
	for _, meth := range AllocationMethods {
		result = append(result, meth.Id)
	}
	sort.Sort(result)
	return gosubs.Prettify(result)
}
Example #8
0
func (self *HTTPContext) AllocationMethodMap() string {
	result := map[string]AllocationMethod{}
	for _, meth := range AllocationMethodMap {
		meth.Translation = self.mI(meth.Name)
		result[meth.Id] = meth
	}
	return gosubs.Prettify(result)
}
Example #9
0
func (self *HTTPContext) VariantMap() string {
	result := map[string]*Variant{}
	for _, variant := range Variants {
		cpy := *variant
		cpy.Translation = self.mI(cpy.Name)
		result[cpy.Id] = &cpy
	}
	return gosubs.Prettify(result)
}
Example #10
0
func (self *HTTPContext) VariantMainProvincesMap() string {
	result := map[string][]dip.Province{}
	for _, variant := range Variants {
		result[variant.Id] = []dip.Province{}
		for _, prov := range variant.Graph.Provinces() {
			if prov.Super() == prov {
				result[variant.Id] = append(result[variant.Id], prov)
			}
		}
	}
	return gosubs.Prettify(result)
}
Example #11
0
func (self *HTTPContext) VariantColorizableProvincesMap() string {
	result := map[string][]dip.Province{}
	for _, variant := range Variants {
		supers := map[dip.Province]bool{}
		for _, prov := range variant.Graph.Provinces() {
			supers[prov.Super()] = true
		}
		for prov, _ := range supers {
			result[variant.Id] = append(result[variant.Id], prov)
		}
	}
	return gosubs.Prettify(result)
}