private string Wear(Command command) { if (_dressHolder.HasOutfit(OutfitType.Pajama)) { throw new PajamaMustTakeOffViolation(); } var outfit = new ClothingFactory(_temperature, _dressHolder).GetClothingInstance(command) .WearAppropriateOutfit(); return(outfit); }
public override string Wear() { if (!_dressHolder.HasOutfit(OutfitType.Pants)) { throw new PantsMustBePutOnBeforeShoesViolation(); } if (_temperature == Temperature.Cold && !_dressHolder.HasOutfit(OutfitType.Socks)) { throw new SocksMustBePutOnBeforeShoesViolation(); } _dressHolder.AddOutfit(OutfitType.FootWear); return(_temperature == Temperature.Hot? Outfit.Sandals.ToDescription():Outfit.Boots.ToDescription()); }
public string WearAppropriateOutfit() { if (_dressHolder.HasOutfit(_type)) { throw new OnlyOnePieceOfEachClothingAllowedViolation(); } return(Wear()); }
public override string Wear() { if (!_dressHolder.HasOutfit(OutfitType.Shirt)) { throw new ShirtMustBePutOnBeforeHeadwearViolation(); } _dressHolder.AddOutfit(OutfitType.HeadWear); return(_temperature == Temperature.Hot ? Outfit.SunVisor.ToDescription() : Outfit.Hat.ToDescription()); }
public override string Wear() { if (!_dressHolder.HasOutfit(OutfitType.Shirt)) { throw new ShirtMustBePutOnBeforeJacketViolation(); } if (_temperature == Temperature.Hot) { throw new CannotPutJacketOnWhenHotViolation(); } _dressHolder.AddOutfit(OutfitType.Jacket); return(Outfit.Jacket.ToDescription()); }