Example #1
0
    public static InGameCard CreateCard(
        CardRow cardRow,
        String id,
        IList <CombatType> combatTypes,
        IList <CardAttribute> attributes,
        int?basePower,
        int?currentPower,
        String faction,
        CombatType?reviveRow)
    {
        GameObject cardObject = Instantiate((GameObject)Resources.Load("InGameCard"), cardRow.transform);
        InGameCard card       = cardObject.GetComponent <InGameCard>();

        card.cardObject   = cardObject;
        card.id           = id;
        card.combatTypes  = new List <CombatType>(combatTypes);
        card.attributes   = new List <CardAttribute>(attributes);
        card.basePower    = basePower;
        card.currentPower = currentPower;
        card.faction      = faction;
        card.reviveRow    = reviveRow;
        card.cardRow      = cardRow;
        card.image        = Resources.Load <Sprite>("CardImages/" + id);
        return(card);
    }
Example #2
0
 public void Update(string name, int strength, CardRow row, CardEffect effect, bool golden)
 {
     Name     = name;
     Strength = strength;
     Row      = row;
     Effect   = effect;
     Golden   = golden;
 }
Example #3
0
 public void Update(string name, int strength, CardRow row, CardEffect effect, bool golden)
 {
     _name     = name;
     _strength = strength;
     Row       = row;
     Effect    = effect;
     Golden    = golden;
     NotifyPropertyChanged("FullName");
 }
Example #4
0
 public TurnEvent SetCardRow(CardRow row)
 {
     if (this.cardRow && this.cardRow != row)
     {
         this.cardRow.RemoveCard(this);
     }
     this.beginDragRow = row.transform;
     this.transform.SetParent(beginDragRow);
     this.cardRow = row;
     return(new TurnEvent(id, cardRow.rowName));
 }
Example #5
0
 public void Discard(DiscardPile discardPile)
 {
     this.transform.SetParent(discardPile.transform);
     this.transform.position = discardPile.transform.position;
     discardPile.AddCard(this);
     if (this.cardRow)
     {
         this.cardRow.RemoveCard(this);
     }
     this.beginDragRow = null;
     this.cardRow      = null;
 }
Example #6
0
 public InGameCard ToInGameCard(CardRow row)
 {
     return(InGameCard.CreateCard(
                row,
                id,
                ParseCombatTypes(this.combatTypes),
                ParseCardAttributes(this.attributes),
                basePower,
                currentPower,
                faction,
                ParseCombatType(reviveRow)));
 }
Example #7
0
 private static void CopyRowValues <T>(CardRow sourceRow, CardRow targetRow, T[] excludeFields)
     where T : Enum
 {
     foreach (var field in Enum.GetValues(typeof(T)))
     {
         if (IsInArray(excludeFields, field))
         {
             continue;
         }
         var sourceRowField = sourceRow[field.ToString()];
         targetRow[field.ToString()] = sourceRowField;
     }
 }
        private void CreateCards(CardDashboardItem cardItem, DashboardObjectDataSource salesDataSource)
        {
            cardItem.DataSource = salesDataSource;
            Card card = new Card();

            card.ActualValue = new Measure("Sales", SummaryType.Sum);
            card.TargetValue = new Measure("SalesTarget", SummaryType.Sum);
            cardItem.SeriesDimensions.Add(new Dimension("State"));
            cardItem.SparklineArgument = new Dimension("CurrentDate", DateTimeGroupInterval.MonthYear);

            CardCustomLayoutTemplate customTemplate = new CardCustomLayoutTemplate();
            CardRow            row1 = new CardRow();
            CardRowDataElement dimensionValue_row1 = new CardRowDataElement(CardRowDataElementType.DimensionValue, 0,
                                                                            CardHorizontalAlignment.Left, 14, System.Drawing.Color.DarkBlue);
            CardRowIndicatorElement deltaIndicator_row1 = new CardRowIndicatorElement(CardHorizontalAlignment.Right, 22);

            row1.Elements.AddRange(dimensionValue_row1, deltaIndicator_row1);

            CardRow            row2            = new CardRow();
            CardRowTextElement staticText_row2 = new CardRowTextElement("Sales: ", CardHorizontalAlignment.Left, 12,
                                                                        CardPredefinedColor.Neutral);
            CardRowDataElement salesValue_row2 = new CardRowDataElement(CardRowDataElementType.ActualValue,
                                                                        CardHorizontalAlignment.Left, 12, CardPredefinedColor.Main);

            row2.Elements.AddRange(staticText_row2, salesValue_row2);

            CardRow            row3            = new CardRow();
            CardRowTextElement staticText_row3 = new CardRowTextElement("Target: ", CardHorizontalAlignment.Left, 12,
                                                                        CardPredefinedColor.Neutral);
            CardRowDataElement salesValue_row3 = new CardRowDataElement(CardRowDataElementType.TargetValue,
                                                                        CardHorizontalAlignment.Left, 12, CardPredefinedColor.Main);

            row3.Indent = 30;
            row3.Elements.AddRange(staticText_row3, salesValue_row3);

            CardSparklineRow row4 = new CardSparklineRow();

            row4.VerticalAlignment = CardVerticalAlignment.Bottom;

            customTemplate.Layout = new CardLayout();
            customTemplate.Layout.Rows.AddRange(row1, row2, row3, row4);
            card.LayoutTemplate = customTemplate;
            cardItem.Cards.Add(card);
        }
Example #9
0
    public void DisplayCards(CardData[] equippedCards)
    {
        gameObject.SetActive(true);
        for (int i = 0; i < equippedCards.Length; i++)
        {
            CardData card    = equippedCards[i];
            CardRow  cardRow = cardRows[i];

            string cardTitle = NO_CARD_TITLE;
            Sprite cardImage = null;
            string cardDesc  = NO_CARD_DESC.Replace("\\n", "\n");
            if (card != null)
            {
                cardTitle = card.ID;
                cardImage = card.cardImage;
                cardDesc  = card.description + "\n" + card.GetStatText();
            }

            cardRow.UpdateCardRow(cardTitle, cardImage, cardDesc);
        }
    }
        CardLayoutTemplate CreateCustomCardLayoutTemplate()
        {
            CardCustomLayoutTemplate customTemplate = new CardCustomLayoutTemplate();
            CardLayout layout = new CardLayout();

            CardSparklineRow sparklineRow = new CardSparklineRow
            {
                Indent            = 10,
                Height            = 40,
                VerticalAlignment = CardVerticalAlignment.Top
            };

            CardRow captionRow = new CardRow
            {
                VerticalAlignment = CardVerticalAlignment.Center
            };
            CardRowTextElement captionTextElement = new CardRowTextElement
            {
                FontSize            = 14,
                HorizontalAlignment = CardHorizontalAlignment.Left,
                Text = "Country: "
            };
            CardRowDataElement captionValueElement = new CardRowDataElement
            {
                ValueType           = CardRowDataElementType.Title,
                FontSize            = 18,
                ForeColor           = Color.Blue,
                FontStyle           = FontStyle.Italic,
                HorizontalAlignment = CardHorizontalAlignment.Right
            };
            CardRowIndicatorElement deltaIndicator = new CardRowIndicatorElement(CardHorizontalAlignment.Right, 22);

            captionRow.Elements.AddRange(captionTextElement, captionValueElement, deltaIndicator);
            CardRow absoluteVariationRow = new CardRow
            {
                VerticalAlignment = CardVerticalAlignment.Center,
                Indent            = 20
            };
            CardRowTextElement absoluteVariationText = new CardRowTextElement
            {
                FontSize            = 16,
                ForeColor           = Color.MediumBlue,
                HorizontalAlignment = CardHorizontalAlignment.Left,
                Text = "Absolute Variation: "
            };
            CardRowDataElement absoluteVariationValue = new CardRowDataElement
            {
                FontSize            = 20,
                ValueType           = CardRowDataElementType.AbsoluteVariation,
                HorizontalAlignment = CardHorizontalAlignment.Right,
                PredefinedForeColor = CardPredefinedColor.Delta
            };

            absoluteVariationRow.Elements.AddRange(absoluteVariationText, absoluteVariationValue);

            CardRow percentVariationRow = new CardRow
            {
                VerticalAlignment = CardVerticalAlignment.Center,
                Indent            = 20
            };
            CardRowTextElement percentVariationText = new CardRowTextElement
            {
                FontSize            = 16,
                ForeColor           = Color.MediumBlue,
                HorizontalAlignment = CardHorizontalAlignment.Left,
                Text = "Percent Variation: "
            };
            CardRowDataElement percentVariationValue = new CardRowDataElement
            {
                FontSize            = 20,
                ValueType           = CardRowDataElementType.PercentVariation,
                PredefinedForeColor = CardPredefinedColor.Delta,
                HorizontalAlignment = CardHorizontalAlignment.Right
            };

            percentVariationRow.Elements.AddRange(percentVariationText, percentVariationValue);

            CardRow percentOfTargetRow = new CardRow
            {
                VerticalAlignment = CardVerticalAlignment.Center,
                Indent            = 20
            };
            CardRowTextElement percentOfTargetText = new CardRowTextElement
            {
                FontSize            = 16,
                ForeColor           = Color.MediumBlue,
                HorizontalAlignment = CardHorizontalAlignment.Left,
                Text = "Percent of Target: "
            };
            CardRowDataElement percentOfTargetValue = new CardRowDataElement
            {
                FontSize            = 20,
                ValueType           = CardRowDataElementType.PercentOfTarget,
                PredefinedForeColor = CardPredefinedColor.Delta,
                HorizontalAlignment = CardHorizontalAlignment.Right
            };

            percentOfTargetRow.Elements.AddRange(percentOfTargetText, percentOfTargetValue);

            CardRow totalSalesRow = new CardRow
            {
                VerticalAlignment = CardVerticalAlignment.Center
            };
            CardRowTextElement totalSalesText = new CardRowTextElement
            {
                FontStyle           = FontStyle.Underline,
                FontSize            = 14,
                ForeColor           = Color.BlueViolet,
                Text                = "Total Sales: ",
                HorizontalAlignment = CardHorizontalAlignment.Left
            };
            CardRowDataElement totalSalesValue = new CardRowDataElement
            {
                ForeColor           = Color.CadetBlue,
                FontSize            = 16,
                ValueType           = CardRowDataElementType.ActualValue,
                HorizontalAlignment = CardHorizontalAlignment.Right
            };

            totalSalesRow.Elements.AddRange(totalSalesText, totalSalesValue);

            CardRow targetSalesRow = new CardRow
            {
                VerticalAlignment = CardVerticalAlignment.Center
            };
            CardRowTextElement targetSalesText = new CardRowTextElement
            {
                FontStyle           = FontStyle.Underline,
                FontSize            = 14,
                ForeColor           = Color.BlueViolet,
                Text                = "Target Sales: ",
                HorizontalAlignment = CardHorizontalAlignment.Left
            };
            CardRowDataElement targetSalesValue = new CardRowDataElement
            {
                ForeColor           = Color.CadetBlue,
                FontSize            = 16,
                ValueType           = CardRowDataElementType.TargetValue,
                HorizontalAlignment = CardHorizontalAlignment.Right
            };

            targetSalesRow.Elements.AddRange(targetSalesText, targetSalesValue);

            layout.Rows.AddRange(sparklineRow,
                                 captionRow,
                                 absoluteVariationRow,
                                 percentVariationRow,
                                 percentOfTargetRow,
                                 totalSalesRow,
                                 targetSalesRow);
            customTemplate.Layout   = layout;
            customTemplate.MinWidth = 300;
            customTemplate.MaxWidth = 350;
            return(customTemplate);
        }
 public void RemoveCardRow(CardRow row) {
     this.Rows.Remove(row);
 }
 public void AddCardRow(CardRow row) {
     this.Rows.Add(row);
 }
 public CardRowChangeEvent(CardRow row, global::System.Data.DataRowAction action) {
     this.eventRow = row;
     this.eventAction = action;
 }
 public PictureRow AddPictureRow(int ID, string SearchText, byte[] Image, string ImageType, System.DateTime DateCreated, CardRow parentCardRowByCard_Picture) {
     PictureRow rowPictureRow = ((PictureRow)(this.NewRow()));
     object[] columnValuesArray = new object[] {
             ID,
             SearchText,
             Image,
             ImageType,
             DateCreated,
             null};
     if ((parentCardRowByCard_Picture != null)) {
         columnValuesArray[5] = parentCardRowByCard_Picture[0];
     }
     rowPictureRow.ItemArray = columnValuesArray;
     this.Rows.Add(rowPictureRow);
     return rowPictureRow;
 }