// TODO: move actions list into subphase
        public void AskPerformFreeAction(List <GenericAction> freeActions, Action callback, string descriptionShort, string descriptionLong = null, IImageHolder imageHolder = null, bool isForced = false)
        {
            foreach (GenericAction freeAction in freeActions)
            {
                if (freeAction.HostShip == null)
                {
                    freeAction.HostShip = Selection.ThisShip;
                }
            }

            GenerateAvailableFreeActionsList(freeActions);

            Triggers.RegisterTrigger(
                new Trigger()
            {
                Name         = "Free action",
                TriggerOwner = this.Owner.PlayerNo,
                TriggerType  = TriggerTypes.OnFreeAction,
                EventHandler = delegate {
                    FreeActionDecisonSubPhase newSubPhase = (FreeActionDecisonSubPhase)Phases.StartTemporarySubPhaseNew
                                                            (
                        "Free action decision",
                        typeof(FreeActionDecisonSubPhase),
                        (Action) delegate {
                        var phase = Phases.CurrentSubPhase as FreeActionDecisonSubPhase;
                        if (phase != null && phase.ActionWasPerformed)
                        {
                            ActionsHolder.TakeActionFinish(
                                delegate
                            {
                                ActionsHolder.EndActionDecisionSubhase(
                                    delegate { FinishFreeActionDecision(callback); }
                                    );
                            }
                                );
                        }
                        else
                        {
                            Selection.ThisShip.CallActionIsSkipped();
                            FinishFreeActionDecision(callback);
                        }
                    }
                                                            );
                    newSubPhase.DecisionOwner    = this.Owner;
                    newSubPhase.ShowSkipButton   = !isForced;
                    newSubPhase.IsForced         = isForced;
                    newSubPhase.DescriptionShort = descriptionShort;
                    newSubPhase.DescriptionLong  = descriptionLong;
                    newSubPhase.ImageSource      = imageHolder;

                    newSubPhase.Start();
                }
            }
                );

            Triggers.ResolveTriggers(TriggerTypes.OnFreeAction, Triggers.FinishTrigger);
        }
        // TODO: move actions list into subphase
        public void AskPerformFreeAction(List <GenericAction> freeActions, Action callback, bool isForced = false)
        {
            GenerateAvailableFreeActionsList(freeActions);

            Triggers.RegisterTrigger(
                new Trigger()
            {
                Name         = "Free action",
                TriggerOwner = Phases.CurrentPhasePlayer,
                TriggerType  = TriggerTypes.OnFreeAction,
                EventHandler = delegate {
                    FreeActionDecisonSubPhase newSubPhase = (FreeActionDecisonSubPhase)Phases.StartTemporarySubPhaseNew
                                                            (
                        "Free action decision",
                        typeof(FreeActionDecisonSubPhase),
                        delegate {
                        var phase = Phases.CurrentSubPhase as FreeActionDecisonSubPhase;
                        if (phase != null && phase.ActionWasPerformed)
                        {
                            Actions.TakeActionFinish(
                                delegate
                            {
                                Actions.EndActionDecisionSubhase(
                                    delegate { FinishFreeActionDecision(callback); }
                                    );
                            }
                                );
                        }
                        else
                        {
                            Selection.ThisShip.CallOnActionDecisionSubphaseEndNoAction();
                            FinishFreeActionDecision(callback);
                        }
                    }
                                                            );
                    newSubPhase.ShowSkipButton = !isForced;
                    newSubPhase.IsForced       = isForced;
                    newSubPhase.Start();
                }
            }
                );

            Triggers.ResolveTriggers(TriggerTypes.OnFreeAction, Triggers.FinishTrigger);
        }