Skip to content

Commit

Permalink
Use bitshift op for weapontype
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Aug 28, 2024
1 parent 750f62f commit e96dc01
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions public/Jailbreak.Validator/ItemValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ public class ItemValidator(
bool allowMultiple = false) : IValidator<string> {
[Flags]
public enum WeaponType {
GRENADE = 1,
UTILITY = 2,
WEAPON = 4,
SNIPERS = 8,
RIFLES = 16,
PISTOLS = 32,
SHOTGUNS = 64,
SMGS = 128,
HEAVY = 256,
GUNS = 512
GRENADE = 1 << 0, // 1
UTILITY = 1 << 1, // 2
WEAPON = 1 << 2, // 4
SNIPERS = 1 << 3, // 8
RIFLES = 1 << 4, // 16
PISTOLS = 1 << 5, // 32
SHOTGUNS = 1 << 6, // 64
SMGS = 1 << 7, // 128
HEAVY = 1 << 8, // 256
GUNS = 1 << 9 // 512
}

public bool Validate(string value, out string? errorMessage) {
Expand Down

0 comments on commit e96dc01

Please sign in to comment.