refactor variable system to be the responsibility of effect enforcer.
This commit is contained in:
@@ -3,7 +3,9 @@ package events
|
||||
import (
|
||||
"fmt"
|
||||
lucifer3 "git.aiterp.net/lucifer3/server"
|
||||
"git.aiterp.net/lucifer3/server/internal/gentools"
|
||||
"github.com/google/uuid"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type AssignmentCreated struct {
|
||||
@@ -32,3 +34,14 @@ type DeviceAssigned struct {
|
||||
func (e DeviceAssigned) EventDescription() string {
|
||||
return fmt.Sprintf("DeviceAssigned(device=%s, %s)", e.DeviceID, e.AssignmentID)
|
||||
}
|
||||
|
||||
type AssignmentVariables struct {
|
||||
ID uuid.UUID
|
||||
Map map[string]float64
|
||||
}
|
||||
|
||||
func (e AssignmentVariables) EventDescription() string {
|
||||
return fmt.Sprintf("AssignmentVariables(id=%s, keys=[%s])",
|
||||
e.ID, strings.Join(gentools.MapKeys(e.Map), ","),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user