コード例 #1
0
ファイル: Battleship.cs プロジェクト: HouseBreaker/OOP
 protected void Destroy(Ship targetShip)
 {
     targetShip.IsDestroyed = true;
 }
コード例 #2
0
ファイル: Battleship.cs プロジェクト: HouseBreaker/OOP
 public abstract string Attack(Ship targetShip);
コード例 #3
0
ファイル: Warship.cs プロジェクト: HouseBreaker/OOP
        public override string Attack(Ship targetShip)
        {
            this.Destroy(targetShip);

            return "Victory is ours!";
        }
コード例 #4
0
ファイル: AircraftCarrier.cs プロジェクト: HouseBreaker/OOP
 public override string Attack(Ship targetShip)
 {
     this.Destroy(targetShip);
     return "We bombed them from the sky!";
 }
コード例 #5
0
ファイル: Destroyer.cs プロジェクト: HouseBreaker/OOP
        public override string Attack(Ship targetShip)
        {
            this.Destroy(targetShip);

            return "They didn't see us coming!";
        }