private string getLength(JobOfferDOM offer) { if (OfferType == JobOfferTypeEnum.Normal) { return(" - "); } return(string.Format("{0} day{1}", offer.Length, PluralHelper.S(offer.Length))); }
public MethodResult <string> UseEquipmentItem(EquipmentItem item, Entity entity) { switch (item.GetProductType()) { case ProductTypeEnum.Tea: { var hpHealed = productService.GetTeaHealedAmount(item.Quality); var prevHp = entity.Citizen.HitPoints; entity.Citizen.HitPoints = Math.Min(100, prevHp + hpHealed); entity.Citizen.DrankTeas++; equipmentRepository.RemoveEquipmentItem(item.EquipmentID, item.ProductID, item.Quality); equipmentRepository.SaveChanges(); hpHealed = entity.Citizen.HitPoints - prevHp; return($"You drank tea and healed {hpHealed} hitpoint{PluralHelper.S(hpHealed)}."); } default: throw new Exception("No action defined for " + EquipmentItemExtension.GetProductType(item).ToString()); } }
public void ReceiveRessistanceHeroMedal(Citizen citizen, War war, int battleWonCount, double goldAmount) { using (var trs = transactionScopeProvider.CreateTransactionScope()) { citizen.RessistanceHeroMedals += 1; var warLink = WarLinkCreator.Create(war); using (NoSaveChanges) warningService.AddWarning(citizen.ID, $"{warLink} has been won and you received {goldAmount} gold for winning {battleWonCount} battle{PluralHelper.S(battleWonCount)}."); ReceiveGoldForMedal(citizen, amount: goldAmount, medalName: "Battle hero"); trs?.Complete(); } }
private string prepareRoomDescription(IEnumerable <HotelRoomInfo> infos) { return(string.Join(", ", infos.OrderBy(i => i.Quality) .Select(i => $"{i.Count} room{PluralHelper.S(i.Count)} Q{i.Quality}"))); }
public virtual void InformCompanyAboutOfferRemovedDueToMinimalWage(JobOffer offer, int count) { var message = $"Your offer{PluralHelper.S(count)} {PluralHelper.Else(count, "was", "were")} deleted due to minimal wage change in country."; warningService.AddWarning(offer.CompanyID, message); }