用户工具


interface IGamePlayer{
    void login();
    void killBoss();
}

class GamePlayer implements IGamePlayer{
    public void login() {System.out.println("login");}
    public void killBoss() {System.out.println("kill boss");}
}
public class GamePlayerProxy implements IGamePlayer{
    IGamePlayer gamePlayer = null;
    public GamePlayerProxy(IGamePlayer gamePlayer){this.gamePlayer=gamePlayer;}
    public void login() {gamePlayer.login();}
    public void killBoss() {gamePlayer.killBoss();}

    public static void main(String[] args) {
        IGamePlayer player = new GamePlayer();
        GamePlayerProxy gamePlayerProxy = new GamePlayerProxy(player);
        gamePlayerProxy.login();
        gamePlayerProxy.killBoss();
    }
}