private void DiplomaticContractCreationComplete(object sender, TicketRaisedEventArgs ticketRaisedEventArgs)
    {
        IDiplomacyService  service = base.Game.Services.GetService <IDiplomacyService>();
        DiplomaticContract diplomaticContract;

        if (!service.TryGetActiveDiplomaticContract(base.Empire, this.selectedEmpire, out diplomaticContract))
        {
            Diagnostics.LogError("Failed to create a valid active contract.");
            this.HandleCancelRequest();
            return;
        }
        this.OnDiplomaticContractChanged(diplomaticContract);
    }
    private void GetOrCreateContract()
    {
        IDiplomacyService  service = base.Game.Services.GetService <IDiplomacyService>();
        DiplomaticContract diplomaticContract;

        if (!service.TryGetActiveDiplomaticContract(base.Empire, this.selectedEmpire, out diplomaticContract))
        {
            OrderCreateDiplomaticContract order = new OrderCreateDiplomaticContract(base.Empire, this.selectedEmpire);
            Diagnostics.Assert(base.PlayerController != null);
            Ticket ticket;
            base.PlayerController.PostOrder(order, out ticket, new EventHandler <TicketRaisedEventArgs>(this.DiplomaticContractCreationComplete));
        }
        else
        {
            this.OnDiplomaticContractChanged(diplomaticContract);
            if (this.SelectedEmpire.IsControlledByAI)
            {
                this.PostOrderGetAIDiplomaticContractEvaluation();
            }
        }
    }