Exemplo n.º 1
0
    public static Hearts operator+(Hearts left, int right)
    {
        Hearts newHP = new Hearts();

        newHP.Recalculate(left.TotalPoints + right);
        return(newHP);
    }
Exemplo n.º 2
0
    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);
    }