public NodeHistoryData(NodeHistory nodeHistory) { nodeNames = nodeHistory.Select(x => x.Key).ToList(); interrupts = nodeHistory.interrupts.ToDictionary( pair => pair.Key, pair => (IReadOnlyDictionary <int, ulong>)pair.Value.ToDictionary( pair2 => pair2.Key, pair2 => pair2.Value ) ); }
// NOTE: Do not use default parameters in constructor or it will fail to compile silently... /// <summary> /// Create a bookmark based on all reached nodes in current gameplay. /// </summary> /// <param name="nodeHistory">List of all reached nodes, including the current node as the last one.</param> /// <param name="dialogueIndex">Index of the current dialogue.</param> public Bookmark(NodeHistory nodeHistory, int dialogueIndex) { nodeHistoryHash = nodeHistory.Hash; this.dialogueIndex = dialogueIndex; }