forked from genshinsim/gcsim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add counter * rename and fix checking normal counter
- Loading branch information
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package queue | ||
|
||
import ( | ||
"errors" | ||
"strings" | ||
|
||
"github.com/genshinsim/gcsim/pkg/core" | ||
) | ||
|
||
func (q *Queuer) evalNormal(cond core.Condition) (bool, error) { | ||
//.normal.X (X = character) | ||
if len(cond.Fields) < 2 { | ||
return false, errors.New("eval normal counter: unexpected short field, expected at least 2") | ||
} | ||
name := strings.TrimPrefix(cond.Fields[1], ".") | ||
key := core.CharNameToKey[name] | ||
char, ok := q.core.CharByName(key) | ||
if !ok { | ||
return false, errors.New("eval normal counter: invalid char in condition") | ||
} | ||
e := char.NextNormalCounter() | ||
return compInt(cond.Op, e, cond.Value), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters