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; }
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); } }