Documentation ¶
Index ¶
- type A
- type Component
- type DamageDirect
- type DamageDirectFeedback
- type DamageOverTime
- type DamageOverTimeFeedback
- type Feedback
- type FeedbackComponent
- type FeedbackMapper
- type FeedbackSubset
- type HealDirect
- type HealDirectFeedback
- type HealOverTime
- type HealOverTimeFeedback
- type Mapper
- type Subset
- type Template
- type TemplateMapper
- type TemplateSubset
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type A ¶
type A struct { ID ulid.ID `json:"id"` Type Type `json:"type"` Name string `json:"name"` MPConsumption uint64 `json:"mp_consumption"` CD uint32 `json:"cd"` CurrentCD uint32 `json:"current_cd"` Components []Component `json:"components"` }
A A represents a ability.
type Component ¶
type Component interface {
Affect(*entity.E) FeedbackComponent
}
Component is a part of a skill.
type DamageDirect ¶
DamageDirect instant damage.
func (DamageDirect) Affect ¶
func (c DamageDirect) Affect(target *entity.E) FeedbackComponent
Affect a DamageDirect on target.
type DamageDirectFeedback ¶
type DamageDirectFeedback struct {
Amount int64
}
DamageDirectFeedback is the feedback of a DamageDirect casted by entity.
func (DamageDirectFeedback) Affect ¶
func (fb DamageDirectFeedback) Affect(e *entity.E)
Affect applies fb on entity.
type DamageOverTime ¶
DamageOverTime inflicts damage per tick.
func (DamageOverTime) Affect ¶
func (c DamageOverTime) Affect(target *entity.E) FeedbackComponent
Affect a DamageOverTime on target.
type DamageOverTimeFeedback ¶
type DamageOverTimeFeedback struct { }
DamageOverTimeFeedback is the feedback of a DamageOverTime casted by entity.
func (DamageOverTimeFeedback) Affect ¶
func (fb DamageOverTimeFeedback) Affect(e *entity.E)
Affect applies fb on entity.
type Feedback ¶
type Feedback struct { ID ulid.ID AbilityID ulid.ID Components []FeedbackComponent }
Feedback represents the effects a ability had on a target.
type FeedbackComponent ¶
FeedbackComponent is the feedback of AbilityComponent.
type FeedbackMapper ¶
type FeedbackMapper interface { SetAbilityFeedback(Feedback) error GetAbilityFeedback(FeedbackSubset) (Feedback, error) }
FeedbackMapper is the communication interface for ability feedbacks.
type HealDirect ¶
HealDirect instant heals.
func (HealDirect) Affect ¶
func (c HealDirect) Affect(target *entity.E) FeedbackComponent
Affect a HealDirect on target.
type HealDirectFeedback ¶
type HealDirectFeedback struct {
Amount int64
}
HealDirectFeedback is the feedback of a HealDirect casted by entity.
func (HealDirectFeedback) Affect ¶
func (fb HealDirectFeedback) Affect(e *entity.E)
Affect applies fb on entity.
type HealOverTime ¶
HealOverTime heals per tick.
func (HealOverTime) Affect ¶
func (c HealOverTime) Affect(target *entity.E) FeedbackComponent
Affect a HealOverTime on target.
type HealOverTimeFeedback ¶
type HealOverTimeFeedback struct { }
HealOverTimeFeedback is the feedback of a HealOverTime casted by entity.
func (HealOverTimeFeedback) Affect ¶
func (fb HealOverTimeFeedback) Affect(e *entity.E)
Affect applies fb on entity.
type Mapper ¶
type Mapper interface { SetAbility(A, ulid.ID) error GetAbility(Subset) (A, error) ListAbility(Subset) ([]A, error) }
Mapper is the communication interface for abilities.
type Template ¶
type Template A
Template alias an entity. It represents semi static data. When creating abilities, those templates are used.
func (*Template) UnmarshalJSON ¶
UnmarshalJSON adds a new field for components `struct` to determine component type.
type TemplateMapper ¶
type TemplateMapper interface { SetAbilityTemplate(Template) error GetAbilityTemplate(TemplateSubset) (Template, error) ListAbilityTemplate() ([]Template, error) }
TemplateMapper is an interface for Template object.
type TemplateSubset ¶
type TemplateSubset struct {
Type Type
}
TemplateSubset is a subset to retrieve one template.