This commit is contained in:
Chomp 2021-09-01 18:22:55 +01:00
parent a5dc5dc09c
commit 611090ec07

View File

@ -1,15 +1,22 @@
using Common.Models; using Common.Models;
using System.Collections.Generic;
namespace Common.Extensions namespace Common.Extensions
{ {
public static class EnumExtensions public static class EnumExtensions
{ {
/// <summary> private static readonly List<BotType> bossTypes = new List<BotType>(){
/// Add a string to a list only if it doesnt already exist BotType.bossbully,
/// </summary> BotType.bossgluhar,
BotType.bosskilla,
BotType.bosskojaniy,
BotType.bosssanitar,
BotType.bosstagilla
};
public static bool IsBoss(this BotType self) public static bool IsBoss(this BotType self)
{ {
return self.HasFlag(BotType.bossbully | BotType.bossgluhar | BotType.bosskilla | BotType.bosskojaniy | BotType.bosssanitar); return bossTypes.Contains(self);
} }
} }
} }