package com.sf._05_接口练习.demo3;

public abstract class Role {
    private String name;
    private int level = 1;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public Role(String name) {
        this.name = name;
    }

    public abstract void attack();

    public void levelUp(){
        level ++;
        System.out.println("恭喜你升到了"+ level+"等级");
    }
}
