package com.openosrs.client.api.types;

public class ExperienceGain {
    private final AgentAPI.Skill skill;
    private final int oldExperience;
    private final int newExperience;
    private final int gain;

    public ExperienceGain(AgentAPI.Skill skill, int oldExperience, int newExperience) {
        this.skill = skill;
        this.oldExperience = oldExperience;
        this.newExperience = newExperience;
        this.gain = newExperience - oldExperience;
    }

    public AgentAPI.Skill getSkill() { return skill; }
    public int getOldExperience() { return oldExperience; }
    public int getNewExperience() { return newExperience; }
    public int getGain() { return gain; }

    @Override
    public String toString() {
        return String.format("ExperienceGain: %s +%d xp (total: %d)",
            skill.name(), gain, newExperience);
    }
}
