예제 #1
0
        public ANameDecorator(BenefitComponent baseComponent, string name)
            : base(baseComponent)
        {
            decimal cost = baseComponent.GetCost();

            _cost = (name.Split(' ').Any(x => x.StartsWith("A", System.StringComparison.InvariantCultureIgnoreCase)))
                ? cost - (cost * .1M) : cost;
        }
예제 #2
0
 public DependentDecorator(BenefitComponent baseComponent)
     : base(baseComponent)
 {
     _cost = baseComponent.GetCost() + 500M;
 }