Skip to content

Commit

Permalink
Added code for setting a description on an attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed May 1, 2023
1 parent 7eea5f0 commit 56a4ed5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/engine/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type attributeinfo struct {
onget AttributeGetFunc
name string
tags []string
description string
mergeSuccesses atomic.Uint64 // number of successfull merges where this attribute was the deciding factor
atype AttributeType
single bool // If true, this attribute can not have multiple values
Expand Down Expand Up @@ -274,6 +275,13 @@ func (a Attribute) Tag(t string) Attribute {
return a
}

func (a Attribute) SetDescription(t string) Attribute {
attributemutex.Lock()
attributenums[a].description = t
attributemutex.Unlock()
return a
}

func (a Attribute) OnSet(onset AttributeSetFunc) Attribute {
attributemutex.Lock()
attributenums[a].onset = onset
Expand Down

0 comments on commit 56a4ed5

Please sign in to comment.