/* rugby-scoring.c
 *
 * Copyright © 2012, 2017 Bruce Cowan <bruce@bcowan.eu>
 *
 * This file is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 3 of the
 * License, or (at your option) any later version.
 *
 * This file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "rugby-possibility.h"
#include "rugby-scoring.h"

gint
rugby_scoring_get_max_tries (gint score)
{
    return (score % 5 == 1) ? score / UTRY_POINTS - 1 : score / UTRY_POINTS;
}

gint
rugby_scoring_get_max_kicks (gint score)
{
    return (score % 3 == 1) ? score / KICK_POINTS : score / KICK_POINTS - 1;
}