public void ReplaceAcquisitionOffer(int newCompanyId, int newBuyerId, AcquisitionTurn newTurn, AcquisitionConditions newBuyerOffer, AcquisitionConditions newSellerOffer) { var index = GameComponentsLookup.AcquisitionOffer; var component = (AcquisitionOfferComponent)CreateComponent(index, typeof(AcquisitionOfferComponent)); component.CompanyId = newCompanyId; component.BuyerId = newBuyerId; component.Turn = newTurn; component.BuyerOffer = newBuyerOffer; component.SellerOffer = newSellerOffer; ReplaceComponent(index, component); }
void RenderCashOffer(AcquisitionConditions BuyerOffer, AcquisitionTurn turn) { var cost = Economy.CostOf(SelectedCompany, Q); long price = BuyerOffer.Price; string overpriceText = ""; if (price > cost) { var overprice = Mathf.Ceil(price * 10 / cost); overpriceText = $" ({(overprice / 10)}x)"; } Offer.text = Format.Money(price) + overpriceText; CashOfferInput.text = price.ToString(); Draw(CashOfferInput, turn == AcquisitionTurn.Buyer); Draw(CashOfferContainer, turn == AcquisitionTurn.Buyer); }