예제 #1
0
func NewBase(name string, holder effect.Effect) *EffectBase {
	return &EffectBase{
		Name:                 name,
		Alive:                false,
		Holder:               holder,
		AttributeCarrierBase: attribute.NewAttributeCarrier(),
	}
}
예제 #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
}