public int CheckBuff(PlayerBuff a) { foreach (PlayerBuff b in currentPlayerBuff) { if (b.ToString().Equals(a.ToString())) { return(currentPlayerBuff.IndexOf(b)); } } return(-1); }