engine: Add setters for the trait interfaces

Turns out it's useful to wholesale set the entire struct.
This commit is contained in:
James Shubin
2018-12-29 01:13:31 -05:00
parent bdc33cd421
commit 4489076fac
6 changed files with 30 additions and 0 deletions

View File

@@ -47,6 +47,12 @@ func (obj *Groupable) AutoGroupMeta() *engine.AutoGroupMeta {
return obj.meta
}
// SetAutoGroupMeta lets you set all of the meta params for the automatic
// grouping trait in a single call.
func (obj *Groupable) SetAutoGroupMeta(meta *engine.AutoGroupMeta) {
obj.meta = meta
}
// GroupCmp compares two resources and decides if they're suitable for grouping.
// You'll probably want to override this method when implementing a resource...
// This base implementation assumes not, so override me!