package seng302.Networking.Messages;

import seng302.Networking.Utils.ByteConverter;
import seng302.Networking.Messages.Enums.BoatStatusEnum;

/**
 * Created by hba56 on 23/04/17.
 */
public class BoatStatus {

    private int sourceID;
    private byte boatStatus;
    private byte legNumber;
    private byte numPenaltiesAwarded;
    private byte numPenaltiesServed;
    private long estTimeAtNextMark;
    private long estTimeAtFinish;

    public BoatStatus(int sourceID, byte boatStatus, byte legNumber, byte numPenaltiesAwarded, byte numPenaltiesServed, long estTimeAtNextMark, long estTimeAtFinish) {
        this.sourceID = sourceID;
        this.boatStatus = boatStatus;
        this.legNumber = legNumber;
        this.numPenaltiesAwarded = numPenaltiesAwarded;
        this.numPenaltiesServed = numPenaltiesServed;
        this.estTimeAtNextMark = estTimeAtNextMark;
        this.estTimeAtFinish = estTimeAtFinish;
    }


    public BoatStatus(int sourceID, BoatStatusEnum boatStatusEnum, int legNum) {
        this.sourceID = sourceID;
        this.boatStatus = boatStatusEnum.getValue();
        this.legNumber = ByteConverter.intToBytes(legNum)[0];
        this.numPenaltiesAwarded = 0;
        this.numPenaltiesServed = 0;
        this.estTimeAtFinish = 0;
        this.estTimeAtNextMark = 0;
    }


    public int getSourceID() {
        return sourceID;
    }

    public byte getBoatStatus() {
        return boatStatus;
    }

    public byte getLegNumber() {
        return legNumber;
    }

    public byte getNumPenaltiesAwarded() {
        return numPenaltiesAwarded;
    }

    public byte getNumPenaltiesServed() {
        return numPenaltiesServed;
    }

    public long getEstTimeAtNextMark() {
        return estTimeAtNextMark;
    }

    public long getEstTimeAtFinish() {
        return estTimeAtFinish;
    }
}
