refactor with sugar-n-spice

This commit is contained in:
2024-12-29 14:03:56 -06:00
parent 69cb97453c
commit 2f42f0c42e
11 changed files with 30 additions and 134 deletions

View File

@@ -1,8 +1,8 @@
package entities
import (
"github.com/DonovanKelly/sugar-n-spice/all"
"go-nkode/config"
py "go-nkode/internal/utils"
)
type KeypadDimension struct {
@@ -26,13 +26,13 @@ func (kp *KeypadDimension) IsValidKeypadDimension() error {
}
func (kp *KeypadDimension) ValidKeySelections(selectedKeys []int) bool {
return py.All[int](selectedKeys, func(idx int) bool {
return all.All[int](selectedKeys, func(idx int) bool {
return 0 <= idx && idx < kp.NumbOfKeys
})
}
func (kp *KeypadDimension) ValidateAttributeIndices(attrIndicies []int) bool {
return py.All[int](attrIndicies, func(i int) bool {
return all.All[int](attrIndicies, func(i int) bool {
return i >= 0 && i < kp.TotalAttrs()
})
}