ff


</details>
classDiagram
    class Player{
        -String name
        #List<Obsever> observers
        +Player(String name)
        +getName(): String
        +attach(Observer observer): void
        +detach(Observer observer): void
        +notifyAllObservers(String attackerName): void
    }
    class Observer{
        +update(Player player,String attackerName):void
    }
    class Alliance{
        -String allianceName
        -List<Player> members
        +Alliance(String allianceName, List<Player> members)
        +join(Player player): void
        +quit(Player player): void
        +notifyAllMembers(String message, Player attacker): void
    }
    class AttackNotifier{
        +static notify(Player player, String attackerName):void
    }
    Player ->> Observer
    Observer ->> Player
    Alliance ->> Player
    AttackNotifier --> Player



posted @ 2023-06-06 21:31  龙俊伟  阅读(152)  评论(0编辑  收藏  举报