basic item filter wip
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package pickit
|
||||
package nip
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package pickit
|
||||
package nip
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package pickit
|
||||
package nip
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const nipLine = "[type] == boots && [quality] == rare # [frw] >= 10 && [fireresist] >= 10 && ([lightresist]+[coldresist] >= 10 && [dexterity] >= 1 && [fireresist]+[poisonresist] >= 10) // this is a comment"
|
||||
|
||||
28
pkg/nip/properties.go
Normal file
28
pkg/nip/properties.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package nip
|
||||
|
||||
const (
|
||||
// Properties
|
||||
PropertyType = "type"
|
||||
PropertyName = "name"
|
||||
PropertyClass = "class"
|
||||
PropertyQuality = "quality"
|
||||
PropertyFlag = "flag"
|
||||
PropertyLevel = "level"
|
||||
PropertyPrefix = "prefix"
|
||||
PropertySuffix = "suffix"
|
||||
|
||||
// Types
|
||||
TypeNormal = "normal"
|
||||
TypeExceptional = "exceptional"
|
||||
TypeElite = "elite"
|
||||
|
||||
// Quality
|
||||
QualityLowQuality = "lowquality"
|
||||
QualityNormal = "normal"
|
||||
QualitySuperior = "superior"
|
||||
QualityMagic = "magic"
|
||||
QualitySet = "set"
|
||||
QualityRare = "rare"
|
||||
QualityUnique = "unique"
|
||||
QualityCrafted = "crafted"
|
||||
)
|
||||
@@ -1,4 +1,4 @@
|
||||
package pickit
|
||||
package nip
|
||||
|
||||
const (
|
||||
OperandEqual Operand = "=="
|
||||
@@ -9,6 +9,7 @@ const (
|
||||
OperandNotEqualTo Operand = "!="
|
||||
OperandAnd Operand = "&&"
|
||||
OperandOr Operand = "||"
|
||||
OperandNone Operand = ""
|
||||
)
|
||||
|
||||
type Rule struct {
|
||||
|
||||
Reference in New Issue
Block a user