/** * Checks if current enemy is valid. * * @return true, if is valid */ public static boolean isValid() { return (npc != null && hp() > 0 && MyPlayer.currentRoom().contains(npc)); }
public static void main(String[] args) { System.out.println("适配器模式"); MyPlayer myPlayer = new MyPlayer(); myPlayer.play("mp3", "h1.mp3"); myPlayer.play("avi", "me.avi"); }