private IEnumerable <IHouseFurnitureObject> getFurniture(House house) { var furnitures = houseFurnitureRepository. Where(f => f.HouseID == house.ID) .Include(f => f.HouseChest) .Include(f => f.House) .ToList(); foreach (var furniture in furnitures) { yield return(HouseFurnitureObjectFactory.CreateHouseFurniture(furniture)); } }
public HouseBaseFurnitureViewModel(HouseFurniture furniture, HouseRights houseRights) { var furnitureObject = HouseFurnitureObjectFactory.CreateHouseFurniture(furniture); Quality = furniture.Quality; MaintainceCost = furnitureObject.CalculateDecay(); Name = furnitureObject.ToHumanReadable().FirstUpper(); HouseID = furniture.HouseID; FurnitureTypeID = furniture.FurnitureTypeID; CanUpgrade = furnitureObject.CanUpgrade() && houseRights.CanModifyHouse; CanManage = houseRights.CanModifyHouse; if (CanUpgrade) { UpgradeCost = furnitureObject.GetUpgradeCost(); } }