package engineer;

import base.Scientist;
import base.EmployeeActions;

public class Engineer implements Scientist, EmployeeActions {
    private double salary;
    private int seniority;

    public Engineer(double salary, int seniority) {
        this.salary = salary;
        this.seniority = seniority;
    }

    @Override
    public double computeBonus() {
        return salary * seniority * 0.01;
    }

    @Override
    public double getSalary() {
        return salary;
    }

    @Override
    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public int getSeniority() {
        return seniority;
    }

    @Override
    public void setSeniority(int seniority) {
        this.seniority = seniority;
    }

    @Override
    public void hire() {
        System.out.println("Engineer hired.");
    }

    @Override
    public void fire() {
        System.out.println("Engineer fired.");
    }

    @Override
    public void transfer() {
        System.out.println("Engineer transferred.");
    }

    @Override
    public void accrueSalary() {
        System.out.println("Total salary: " + (salary + computeBonus()));
    }

    @Override
    public String toString() {
        return "Engineer { salary = " + salary +
                ", seniority = " + seniority +
                ", bonus = " + computeBonus() +
                ", totalSalary = " + (salary + computeBonus()) + " }";
    }
}
