public Node LoadNode(uint id) { var node = new Node { ID = id, State = NodeState.ACTIVE }; node.Type = id < fileReader.ReadInt24(DataFileType.INFO, INFO.NODE_NUMBER_SIZE) ? NodeType.CATEGORY : NodeType.ARTICLE; long nodeMapFilePos = id * MAP.LINE_SIZE; loadNodeConnections(ref node, nodeMapFilePos); uint nodeTitleFilePos = fileReader.ReadInt(DataFileType.MAP, nodeMapFilePos + MAP.GRAPH_OFFSET_SIZE); node.WikiID = fileReader.ReadInt(DataFileType.MAP, nodeMapFilePos + MAP.GRAPH_OFFSET_SIZE + MAP.TITLE_OFFSET_SIZE); uint nextNodeTitleFilePos = getNextNodePropPos(DataFileType.TITLES, nodeMapFilePos + MAP.LINE_SIZE + MAP.GRAPH_OFFSET_SIZE); node.Title = fileReader.ReadString(DataFileType.TITLES, nodeTitleFilePos, (int)(nextNodeTitleFilePos - nodeTitleFilePos)); return(node); }
public NodeLoader(string dataPack, string dataPackDate) { fileReader = new DataFileReader(dataPack, dataPackDate); nodeTypeBorder = fileReader.ReadInt(DataFileType.INFO, 0); }