basic item filter wip

This commit is contained in:
Héctor Giménez
2023-03-12 19:32:50 +09:00
parent 306150e873
commit 66dd506ba7
12 changed files with 273 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
package pickit
package nip
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package pickit
package nip
import (
"errors"

View File

@@ -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
View 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"
)

View File

@@ -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 {