Exemple #1
0
        private void HandleConfirmTransferOwnershipResponse(int responseID)
        {
            Model model = GetDialogCustomData <Model>();

            switch (responseID)
            {
            case 1:     // Confirm / REALLY CONFIRM
                if (model.IsConfirmingTransferTerritory)
                {
                    // Buildings
                    if (model.FlagMarker == null)
                    {
                        _structure.TransferBuildingOwnership(GetDialogTarget().Area, model.TransferPlayerID);
                    }
                    // Territories
                    else
                    {
                        _structure.TransferTerritoryOwnership(model.FlagMarker, model.TransferPlayerID);
                    }

                    EndConversation();
                }
                else
                {
                    model.IsConfirmingTransferTerritory = true;
                    SetResponseText("ConfirmTransferOwnershipPage", 1, "REALLY CONFIRM TRANSFER TERRITORY");
                }

                break;

            case 2:     // Back
                SetResponseText("ConfirmTransferOwnershipPage", 1, "Confirm Transfer Territory");
                model.IsConfirmingTransferTerritory = false;
                LoadTransferOwnershipResponses();
                ChangePage("TransferOwnershipPage");
                break;
            }
        }