public static Hearts operator+(Hearts left, int right) { Hearts newHP = new Hearts(); newHP.Recalculate(left.TotalPoints + right); return(newHP); }
public static Hearts operator-(Hearts left, int right) { Hearts newHP = new Hearts(); int newPoints = left.TotalPoints - right; if (newPoints < 0) { newPoints = 0; } newHP.Recalculate(newPoints); return(newHP); }