Esempio n. 1
0
func NewBase(name string, holder effect.Effect) *EffectBase {
	return &EffectBase{
		Name:                 name,
		Alive:                false,
		Holder:               holder,
		AttributeCarrierBase: attribute.NewAttributeCarrier(),
	}
}
Esempio n. 2
0
//创建一个角色对象
func NewCharacter(id string, givenName, familyName string, attributes map[string]*attribute.AttributeLike) *Character {
	var c = &Character{
		Id:                   id,
		GivenName:            givenName,
		FamilyName:           familyName,
		EventEmitterBase:     event.NewEventEmitter(),
		AttributeCarrierBase: attribute.NewAttributeCarrier(),
		EffectCarrierBase:    effect.NewEffectCarrier(),
		SkillCarrierBase:     skill.NewSkillCarrierBase(),
	}
	return c
}