Пример #1
0
    private static SaveData.SerializableOrdersDictionary ConvertActiveOrdersForSaving(
        Dictionary <string, PizzaOrder> activeOrders)
    {
        var convertedOrders = new SaveData.SerializableOrdersDictionary();

        foreach (var order in activeOrders.Keys)
        {
            if (convertedOrders.ContainsKey(order))
            {
                Debug.Log("Order " + order + " already exists in converted orders!");
                continue;
            }

            convertedOrders.Add(order, PizzaOrderSdo.ConvertToPizzaOrderSdo(activeOrders[order]));
        }

        return(convertedOrders);
    }
Пример #2
0
    private static Dictionary <string, PizzaOrder> ConvertActiveOrdersForPlaying(
        SaveData.SerializableOrdersDictionary orderSdos)
    {
        var activeOrders = new Dictionary <string, PizzaOrder>();

        foreach (var sdo in orderSdos)
        {
            if (activeOrders.ContainsKey(sdo.Key))
            {
                continue;
            }

            var order = PizzaOrderSdo.ConvertToPizzaOrder(sdo.Value);

            activeOrders.Add(sdo.Key, order);
        }

        return(activeOrders);
    }