public Contract(List <ContractAttribute> attributes) { this.Title = "New Title"; this.GoodAttribute = SelectAttribute(ContractType.Good, attributes); this.BadAttribute = SelectAttribute(ContractType.Bad, attributes); this.RejectAttribute = SelectAttribute(ContractType.Reject, attributes); }
private void RunAttribute(ContractAttribute attribute) { switch (attribute.AttributeType) { case AttributeType.GoodQualityPercent: new GoodQualityPercent().PerformAction(attribute); break; case AttributeType.BadQualityPercent: new BadQualityPercent().PerformAction(attribute); break; case AttributeType.Money: new MoneyAmount().PerformAction(attribute); break; case AttributeType.MoneySubtract: new MoneyAmount().PerformAction(attribute, true); break; case AttributeType.ContractTimePercentDecrease: new ContractTimePercent().PerformAction(attribute, true); break; case AttributeType.ContractTimePercentIncrease: new ContractTimePercent().PerformAction(attribute); break; case AttributeType.ContractIncrease: new ContractNumber().PerformAction(attribute); break; default: throw new ArgumentOutOfRangeException(); } }