public MethodResult CanOfferMPP(Entity entity, Country proposingCountry, Country secondCountry, int days) { if (secondCountry == null) { return(new MethodResult("Country does not exist!")); } var result = CanOfferMPP(entity, proposingCountry); if (result.IsError) { return(result); } if (proposingCountry.ID == secondCountry.ID) { return(new MethodResult("You cannot have MPP with yourself!")); } if (militaryProtectionPactRepository.AreAlreadyHaveMPP(proposingCountry.ID, secondCountry.ID)) { return(new MethodResult("You already have MPP!")); } if (militaryProtectionPactOfferRepository.AreAlreadyHaveMPP(proposingCountry.ID, secondCountry.ID)) { return(new MethodResult("You already have MPP offer between you!")); } var minLength = ConfigurationHelper.Configuration.MinimumMPPLength; var maxLength = ConfigurationHelper.Configuration.MaximumMPPLength; if (days < minLength) { return(new MethodResult($"Days must be bigger than {minLength}!")); } else if (days > maxLength) { return(new MethodResult($"Days must be lower than {maxLength}!")); } var goldCost = CalculateMPPCost(days); var money = new Money(GameHelper.Gold, goldCost); if (walletService.HaveMoney(proposingCountry.Entity.WalletID, money) == false) { return(new MethodResult($"{proposingCountry.Entity.Name} does not have enough gold! It needs {goldCost} gold.")); } if (warService.AreAtWar(proposingCountry, secondCountry)) { return(new MethodResult("Both countries are at war. You cannot do that.")); } return(MethodResult.Success); }