示例#1
0
func ToSetting(id SettingID) (*Setting, bool) {
	result, ok := IDer.UnpackPickler(intern.ID(id), &Setting{})
	if !ok {
		return nil, false
	}
	return result.(*Setting), true
}
示例#2
0
func ToActionC(id ActionCID) (ActionC, bool) {
	result, ok := IDer.UnpackPickler(intern.ID(id), ActionC{})
	if !ok {
		return ActionC{}, false
	}
	return result.(ActionC), true
}
示例#3
0
func ToT(id TID) (T, bool) {
	unpacked, ok := IDer.UnpackPickler(intern.ID(id), &CompoundT{})
	if !ok {
		return nil, false
	}
	return unpacked.(T), ok
}
示例#4
0
func ToTemplate(id TemplateID) (*Template, bool) {
	unpacked, ok := IDer.UnpackPickler(intern.ID(id), &Template{})
	if !ok {
		return nil, false
	}
	return unpacked.(*Template), ok
}
示例#5
0
func (s *Setting) Append(line SettingLine, slotss ...int) *Setting {
	var slots int
	if len(slotss) == 0 {
		slots = line.Slots()
	} else {
		slots = slotss[0]
	}
	return &Setting{
		Previous: s,
		Last:     line,
		Slots:    slots,
		Size:     s.Size + 1,
		ID: SettingID(IDer.AppendToPacked(
			intern.ID(s.ID),
			line.LineID(),
		).(intern.ID)),
	}
}
示例#6
0
func (t TemplateID) LineID() intern.ID {
	return intern.ID(t)
}
示例#7
0
func (a ActionCID) LineID() intern.ID {
	return intern.ID(a)
}
示例#8
0
func ToC(id CID) (C, bool) {
	unpacked, ok := IDer.UnpackPickler(intern.ID(id), &CompoundC{})
	return unpacked.(C), ok
}