赋值的左侧必须是变量

时间:2017-08-12 09:56:05

标签: java

我有一个问题我认为这可能是一个简单的修复,但我目前卡住了。

我试过环顾四周但找不到任何有用的东西。

这是我的错误:作业的左侧必须是变量

Code error picture here aswell

这是我的代码:

} else if (token.equals("character-rights")) {
        player.getRights().ordinal() = Integer.parseInt(token2);


    public enum PlayerRights {

    PLAYER(true, true, true, true, false, 60),
    MODERATOR(true, true, true, true, false, 0),
    ADMINISTRATOR(false, false, false, false, false, 0),
    DEVELOPER(true, true, true, true, true, 0),
    DONATOR(true, true, true, true, true, 10);

    private boolean canTrade, canDuel, canPk, canSell, debugMode;
    private int yellTimer;

    private PlayerRights(boolean canTrade, boolean canDuel, boolean canPk, boolean canSell, boolean debugMode, int yellTimer) {
        this.canTrade = canTrade;
        this.canDuel = canDuel;
        this.canPk = canPk;
        this.canSell = canSell;
        this.debugMode = debugMode;
        this.yellTimer = yellTimer;
    }

    private static final ImmutableSet<PlayerRights> STAFF = Sets.immutableEnumSet(ADMINISTRATOR, DEVELOPER);
    private static final ImmutableSet<PlayerRights> MEMBERS = Sets.immutableEnumSet(MODERATOR, ADMINISTRATOR, DEVELOPER, DONATOR);
    private static final ImmutableSet<PlayerRights> NORMAL = Sets.immutableEnumSet(PLAYER, DONATOR);

    public boolean isStaff() {
        return STAFF.contains(this);
    }

    public boolean isMember() {
        return MEMBERS.contains(this);
    }

    public boolean isPlayer() {
        return NORMAL.contains(this);
    }

    public boolean canTrade() {
        return canTrade;
    }

    public boolean canDebug() {
        return debugMode;
    }

    public boolean canSell() {
        return canSell;
    }

    public boolean canDuel() {
        return canDuel;
    }

    public boolean canPk() {
        return canPk;
    }

    public int getYellTimer() {
        return yellTimer;
    }

}

public PlayerRights playerRights;

public PlayerRights getRights() {
    return playerRights;
}

顶部代码是发生错误的地方。我真的很感激一些帮助,会让我的一天。

0 个答案:

没有答案