private ActionIndicatorPattern Compile(ActionIndicatorPatternCompileArgs args)
        {
            ActionIndicatorPattern pattern = new ActionIndicatorPattern();

            pattern.indicators = new List <ActionIndicator>();

            List <TurnAction> options = args.options.options;

            for (int o = 0; o < options.Count; o++)
            {
                if (args.showOnly == null || args.showOnly.Contains(o))
                {
                    TurnAction action = options[o];
                    for (int c = 0; c < action.components.Count; c++)
                    {
                        TurnActionComponent comp     = action.components[c];
                        IntVector2          boardPos = GetBoardPosition(comp);
                        ActionIndicatorType type     = GetIndicatorType(comp);
                        int decorationModel          = GetDecorationModel(comp);
                        int promotionPiece           = GetPromotionPiece(comp);
                        ActionIndicatorStrength strength;
                        if (args.mouseOverMode)
                        {
                            strength = ActionIndicatorStrength.Mouseover;
                        }
                        else if (o == args.highlightedIndex)
                        {
                            strength = ActionIndicatorStrength.Selected;
                        }
                        else
                        {
                            strength = ActionIndicatorStrength.Inactive;
                        }

                        if (!CheckForDuplicates(pattern, boardPos, type, decorationModel, promotionPiece, strength))
                        {
                            pattern.indicators.Add(new ActionIndicator()
                            {
                                boardPosition   = boardPos,
                                type            = type,
                                decorationModel = decorationModel,
                                strength        = strength,
                                promotionPiece  = promotionPiece,
                            });
                        }
                    }
                }
            }

            return(pattern);
        }
 private bool CheckForDuplicates(ActionIndicatorPattern pattern, IntVector2 pos, ActionIndicatorType type, int decorationModel,
                                 int promotionPiece, ActionIndicatorStrength strength)
 {
     for (int i = 0; i < pattern.indicators.Count; i++)
     {
         ActionIndicator ind = pattern.indicators[i];
         if (ind.boardPosition == pos && ind.type == type && ind.decorationModel == decorationModel && ind.promotionPiece == promotionPiece)
         {
             if ((int)ind.strength > (int)strength)
             {
                 ind.strength = strength;
             }
             return(true);
         }
     }
     return(false);
 }