Example #1
0
 private void OnEndEditCalulatorInputCard(UICardDesk desk, UICardPile pile, UICard card)
 {
     if (card != null && card == calculatorInputCard)
     {
         RefreshCalculator();
     }
 }
Example #2
0
 private void OnSwitchDesk(UICardDesk newDesk)
 {
     if (deskBuilder != null)
     {
         deskBuilder.Build(newDesk);
     }
 }
Example #3
0
 private void OnEndEditDatabaseCard(UICardDesk desk, UICardPile pile, UICard card)
 {
     if (card != null && card == databaseCard)
     {
         Database editedData = databaseCard.Data as Database;
         DatapackSerializer.Serialize(editedData, databaseSavePath);
         databaseCard.Data = editedData;
         //onSaveDatabase?.Invoke((Database)card.Data);
     }
 }
Example #4
0
    //private void OnEnable()
    //{
    //    List<UICardPile> piles = new List<UICardPile>();
    //    pileBuilders = GetComponentsInChildren<UICardPileBuilder>(true);
    //    foreach (UICardPileBuilder builder in pileBuilders)
    //    {
    //        builder.ResetPile();
    //        piles.Add(builder.CurrentPile);
    //    }
    //    CurrentDesk = new UICardDesk(piles.ToArray());
    //}

    public void Build(UICardDesk desk)
    {
        Clear();
        CurrentDesk = desk;
        if (CurrentDesk != null)
        {
            if (CurrentDesk.PileCount != pileBuilders.Length)
            {
                Debug.LogError("Desk / DeskBuilder size mismatch");
            }
            else
            {
                for (int i = 0, iend = pileBuilders.Length; i < iend; i++)
                {
                    if (pileBuilders[i] == null)
                    {
                        continue;
                    }
                    pileBuilders[i].BuildPile(CurrentDesk.CardPiles[i]);
                }
            }
        }
    }