コード例 #1
0
ファイル: Cannon.cs プロジェクト: kevgeniy/study-projects
 public TCannon(String name, TCapacity capacity, Int32 maxCannonballWeight, TShipParts sharpshooting)
 {
     this._name               = name;
     this.Capacity            = capacity;
     this.MaxCannonballWeight = maxCannonballWeight;
     this.Sharpshooting       = sharpshooting;
 }
コード例 #2
0
        public Drink(Int32 capacity, bool extraFood)
        {
            Name           = "Drink";
            this.ExtraFood = extraFood;
            switch (capacity)
            {
            case 0:
                this.Cost     = 200;
                this.Capacity = TCapacity.small;
                break;

            case 1:
                this.Cost     = 400;
                this.Capacity = TCapacity.middle;
                break;

            case 2:
                this.Cost     = 600;
                this.Capacity = TCapacity.large;
                break;

            default:
                this.Cost     = 200;
                this.Capacity = TCapacity.small;
                break;
            }
        }
コード例 #3
0
 public TCannonBall(String name, TCapacity capacity, Int32 airResistence, TShipParts damage, TShipParts sharpshooting)
 {
     this._name         = name;
     this.Capacity      = capacity;
     this.AirResistence = airResistence;
     this.Damage        = damage;
     this.Sharpshooting = sharpshooting;
 }