private void LoadSpreadsheet(byte[] table, string path, params string[] tileColumns) { Spreadsheet ss = new Spreadsheet(path); int[] tileCIDs = new int[tileColumns.Length]; for (int i = 0; i < tileColumns.Length; ++i) { tileCIDs[i] = ss.GetColumnID(tileColumns[i]); } int featureCID = ss.GetColumnID("FeatureMask"); for (int i = 0; i < ss.Records.Length; ++i) { DataRecord record = ss.Records[i]; byte fid = (byte)record.GetInt32(featureCID); for (int j = 0; j < tileCIDs.Length; ++j) { int itemID = record.GetInt32(tileCIDs[j]); if (itemID <= 0 || itemID >= table.Length) { continue; } table[itemID] = fid; } } }
public object this[string name] { get { return(this[m_Spreadsheet.GetColumnID(name)]); } }
private void LoadSpreadsheet( byte[] table, string path, params string[] tileColumns ) { Spreadsheet ss = new Spreadsheet( path ); int[] tileCIDs = new int[tileColumns.Length]; for ( int i = 0; i < tileColumns.Length; ++i ) tileCIDs[i] = ss.GetColumnID( tileColumns[i] ); int featureCID = ss.GetColumnID( "FeatureMask" ); for ( int i = 0; i < ss.Records.Length; ++i ) { DataRecord record = ss.Records[i]; byte fid = (byte) record.GetInt32( featureCID ); for ( int j = 0; j < tileCIDs.Length; ++j ) { int itemID = record.GetInt32( tileCIDs[j] ); if ( itemID <= 0 || itemID >= table.Length ) continue; table[itemID] = fid; } } }