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