Пример #1
0
 public ResultModel(Dictionary serialized) : base(serialized)
 {
     id = serialized["id"].ToGuid();
     materialItemIdList = serialized["materialItemIdList"].ToList(StateExtensions.ToGuid);
     gold              = serialized["gold"].ToBigInteger();
     actionPoint       = serialized["actionPoint"].ToInteger();
     enhancementResult = serialized["enhancementResult"].ToEnum <EnhancementResult>();
     preItemUsable     = serialized.ContainsKey("preItemUsable")
         ? (ItemUsable)ItemFactory.Deserialize((Dictionary)serialized["preItemUsable"])
         : null;
 }
Пример #2
0
        public static int GetRequiredBlockCount(EnhancementCostSheetV2.Row row, EnhancementResult result)
        {
            switch (result)
            {
            case EnhancementResult.GreatSuccess:
                return(row.GreatSuccessRequiredBlockIndex);

            case EnhancementResult.Success:
                return(row.SuccessRequiredBlockIndex);

            case EnhancementResult.Fail:
                return(row.FailRequiredBlockIndex);

            default:
                throw new ArgumentOutOfRangeException(nameof(result), result, null);
            }
        }