package com.linusblom.dart2.models.game.legs;

import com.linusblom.dart2.models.player.Player;

public class LegsPlayer {
    private Player player;
    private int lastScore;
    private int legs;

    public LegsPlayer(Player player, boolean extended) {
        this.player = player;
        this.legs = extended ? 5 : 3;
    }

    public Player getPlayer() {
        return player;
    }

    public String getName() {
        return player.getName();
    }

    public int getLastScore() {
        return lastScore;
    }

    public void setLastScore(int lastScore) {
        this.lastScore = lastScore;
    }

    public String getLegs() {
        String legsToReturn = "";
        for (int i = 0; i < legs; i++) {
            legsToReturn += "X ";
        }
        return legsToReturn;
    }

    public boolean removeLeg() {
        return --legs == 0;
    }
}
