Ejemplo n.º 1
0
        public static void PrintGachaResult(GachaResult result, MainWindowViewModel viewModel)
        {
            string history = "";
            foreach (var item in result.list)
            {

                if ("item".Equals(item.type))
                {
                    history += String.Format("{0} x {1}", item.name, item.value) + Environment.NewLine;
                }
                else if ("card".Equals(item.type))
                {
                    string rare = "";
                    switch (item.rare)
                    {
                        case 4:
                            rare = "[欧皇]";
                            break;
                        case 3:
                            rare = "[脸帝]";
                            break;
                        case 2:
                            rare = "[狗粮]";
                            break;
                        case 1:
                            rare = "[渣渣]";
                            break;
                        default:
                            rare = "[????]";
                            break;
                    }

                    history += String.Format("{0}{1} x {2}", rare, item.name, item.value) + Environment.NewLine;
                }
            }
            viewModel.History = history;
        }
Ejemplo n.º 2
0
 public static void UpdateGachaResult(GachaResult result, MainWindowViewModel viewModel)
 {
     viewModel.CardQuantity = result.card.value;
     viewModel.CardMax = result.card.max;
 }