// TODO: check for overflow public static VoteEnum IncreaseVotesCount(this VoteEnum vote, int diff) => vote .RemoveFlags(VoteEnum.Plus) .CombineFlags((VoteEnum)((((int)vote.CommonFlags(VoteEnum.Plus) >> FirstPlusBit) + diff) << FirstPlusBit));
public static int GetPlusVotesCount(this VoteEnum?vote) => ((int)(vote?.CommonFlags(VoteEnum.Plus) ?? VoteEnum.None) >> FirstPlusBit);