add dat base
This commit is contained in:
+7
-1
@@ -3,13 +3,19 @@ package commands
|
||||
import (
|
||||
"fmt"
|
||||
lucifer3 "git.aiterp.net/lucifer3/server"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Assign struct {
|
||||
ID *uuid.UUID `json:"id"`
|
||||
Match string `json:"match"`
|
||||
Effect lucifer3.Effect `json:"effect"`
|
||||
}
|
||||
|
||||
func (c Assign) CommandDescription() string {
|
||||
return fmt.Sprintf("Assign(%s, %s)", c.Match, c.Effect.EffectDescription())
|
||||
if c.ID != nil {
|
||||
return fmt.Sprintf("Assign(%s, %s, id=%s)", c.Match, c.Effect.EffectDescription(), *c.ID)
|
||||
} else {
|
||||
return fmt.Sprintf("Assign(%s, %s)", c.Match, c.Effect.EffectDescription())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,3 +58,11 @@ func (c SearchDevices) Matches(driver string) (string, bool) {
|
||||
func (c SearchDevices) CommandDescription() string {
|
||||
return fmt.Sprintf("SearchDevices(%s, %#+v)", c.ID, c.Hint)
|
||||
}
|
||||
|
||||
type ForgetDevice struct {
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
func (c ForgetDevice) CommandDescription() string {
|
||||
return fmt.Sprintf("ForgetDevice(%s)", c.ID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user