コード例 #1
0
        private static void Main(string[] args)
        {
            var boxFight = new BoxFight();

            boxFight.AttachObserver(new RiskyPlayer());
            boxFight.AttachObserver(new ConservativePlayer());

            boxFight.NextRound();
            boxFight.NextRound();
            boxFight.NextRound();
            boxFight.NextRound();
        }
コード例 #2
0
ファイル: Using.cs プロジェクト: olko/MySpace
 public void run()
 {
     var boxFight = new BoxFight();
     var riskyPlayer = new RiskyPlayer();
     var conservativePlayer = new ConservativePlayer();
     boxFight.AttachObserver(riskyPlayer);
     boxFight.AttachObserver(conservativePlayer);
     boxFight.NextRound();
     boxFight.NextRound();
     boxFight.NextRound();
     boxFight.NextRound();
 }