mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-16 06:06:11 +01:00
feat: provisions
This commit is contained in:
1 parent
561b59d235
commit
5bbe93bcec
14 files changed
+233
-53
No files matched your search
@@ -1,12 +1,13 @@
|
||||
import { ConsumableEntry } from './consumablesDefinitions';
|
||||
import { ConsumableEntry } from './consumableDefinitions';
|
||||
import { ProvisionEntry } from './provisionDefinitions';
|
||||
import { GunDefinition, TankDefinition } from './tankDefinitions';
|
||||
|
||||
export function checkConsumableInclusivity(
|
||||
consumable: ConsumableEntry,
|
||||
export function checkConsumableProvisionInclusivity(
|
||||
consumableProvision: ConsumableEntry | ProvisionEntry,
|
||||
tank: TankDefinition,
|
||||
gun: GunDefinition,
|
||||
) {
|
||||
const included = consumable.include.every((rule) => {
|
||||
const included = consumableProvision.include.every((rule) => {
|
||||
switch (rule.type) {
|
||||
case 'tier':
|
||||
return rule.min <= tank.tier && tank.tier <= rule.max;
|
||||
@@ -18,7 +19,7 @@ export function checkConsumableInclusivity(
|
||||
throw new SyntaxError('Category filtering found in include rule');
|
||||
}
|
||||
});
|
||||
const excluded = consumable.exclude?.some((rule) => {
|
||||
const excluded = consumableProvision.exclude?.some((rule) => {
|
||||
switch (rule.type) {
|
||||
case 'tier':
|
||||
return rule.min <= tank.tier && tank.tier <= rule.max;
|
||||
|
||||
Reference in new issue
Block a user