// Start is called before the first frame update void Awake() { nodes = new List <CSVNode>(); try { string[] CSVContents = File.ReadAllLines(System.Environment.CurrentDirectory + @"\" + Filename); CSVTitles = CSVContents[0]; for (int i = 1; i < CSVContents.Length; i++) { CSVNode n = new CSVNode(); n.FullContents = CSVContents[i]; n.Split(); nodes.Add(n); } FirstHundred = new CSVNodeGroup(); for (int i = 0; i < 100; i++) { FirstHundred.nodes.Add(nodes[i]); } } catch (IOException e) { Debug.LogError(e.ToString()); } }
public static void InitDataTable(CSVNode node, LogicDataType index) { if (index == LogicDataType.ANIMATION) { if (LogicDataTables.m_animationTable != null) { LogicDataTables.m_animationTable.SetTable(node); } else { LogicDataTables.m_animationTable = new LogicAnimationTable(node, index); } } else { if (LogicDataTables.m_tables[(int)index] != null) { LogicDataTables.m_tables[(int)index].SetTable(node.GetTable()); } else { switch (index) { case LogicDataType.GLOBAL: LogicDataTables.m_tables[(int)index] = new LogicGlobals(node.GetTable(), index); break; case LogicDataType.CLIENT_GLOBAL: LogicDataTables.m_tables[(int)index] = new LogicClientGlobals(node.GetTable(), index); break; default: LogicDataTables.m_tables[(int)index] = new LogicDataTable(node.GetTable(), index); break; } } } }
public LogicAnimationTable(CSVNode node, LogicDataType index) : base(node.GetTable(), index) { }
public void SetTable(CSVNode node) { // TODO: Implement this. }
public static void Load(LogicArrayList <LogicDataTableResource> resources, int idx, CSVNode node) { LogicDataTableResource resource = resources[idx]; switch (resource.GetTableType()) { case 0: LogicDataTables.InitDataTable(node, resource.GetTableIndex()); break; case 3: // LogicStringTable. break; default: Debugger.Error("LogicResources::Invalid resource type"); break; } if (resources.Size() - 1 == idx) { LogicDataTables.CreateReferences(); } }