Ejemplo n.º 1
0
        public override void PrepareDecision(System.Action callBack)
        {
            InfoText = "Select a trigger to resolve";

            List <Trigger> currentTriggersList = Triggers.GetCurrentLevel().GetTriggersByPlayer(Phases.PlayerWithInitiative);

            Players.PlayerNo currentPlayer = (currentTriggersList.Count > 0) ? Phases.PlayerWithInitiative : Roster.AnotherPlayer(Phases.PlayerWithInitiative);
            currentTriggersList = Triggers.GetCurrentLevel().GetTriggersByPlayer(currentPlayer);

            foreach (var trigger in currentTriggersList)
            {
                if (trigger.TriggerOwner == currentPlayer)
                {
                    AddDecision(trigger.Name, delegate {
                        Phases.FinishSubPhase(this.GetType());
                        FireTrigger(trigger);
                    });
                }
            }

            DecisionOwner       = Roster.GetPlayer(currentPlayer);
            DefaultDecisionName = GetDecisions().First().Name;

            callBack();
        }
Ejemplo n.º 2
0
    // PRIVATE

    private static bool NewLevelIsRequired()
    {
        return((TriggersStack.Count == 0) || (Triggers.GetCurrentLevel().IsActive));
    }