public bool StoreGuarantee() { var propMetal = ProposingFactionGuarantee ?? 0; var acceptMetal = AcceptingFactionGuarantee ?? 0; if (FactionByProposingFactionID.Metal >= propMetal && FactionByAcceptingFactionID.Metal >= acceptMetal) { FactionByProposingFactionID.SpendMetal(propMetal); FactionByAcceptingFactionID.SpendMetal(acceptMetal); return(true); } return(false); }
public void CancelTreaty(Faction faction) { bool wasAccepted = TreatyState == TreatyState.Accepted; TreatyState = TreatyState.Cancelled; if (wasAccepted) { if (faction?.FactionID == AcceptingFactionID) { FactionByProposingFactionID.ProduceMetal(AcceptingFactionGuarantee ?? 0); FactionByProposingFactionID.ProduceMetal(ProposingFactionGuarantee ?? 0); } else { FactionByAcceptingFactionID.ProduceMetal(AcceptingFactionGuarantee ?? 0); FactionByAcceptingFactionID.ProduceMetal(ProposingFactionGuarantee ?? 0); } } }