refactor with sugar-n-spice
This commit is contained in:
@@ -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()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user