Ejemplo n.º 1
0
        private void LoadSpreadsheet(int[] 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];

                int fid = 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;
                }
            }
        }
Ejemplo n.º 2
0
 public DataRecord(Spreadsheet ss, object[] data)
 {
     this.m_Spreadsheet = ss;
     this.m_Data = data;
 }
		private static void LoadSpreadsheet(int[] table, string path, params string[] tileColumns)
		{
			var ss = new Spreadsheet(path);

			var tileCIDs = new int[tileColumns.Length];

			for (var i = 0; i < tileColumns.Length; ++i)
			{
				tileCIDs[i] = ss.GetColumnID(tileColumns[i]);
			}

			var featureCID = ss.GetColumnID("FeatureMask");

			foreach (var record in ss.Records)
			{
				var fid = record.GetInt32(featureCID);

				foreach (var itemID in tileCIDs.Select(v => record.GetInt32(v)).Where(id => id > 0 && id < table.Length))
				{
					table[itemID] = fid;
				}
			}
		}
 public DataRecord(Spreadsheet ss, object[] data)
 {
     this.m_Spreadsheet = ss;
     this.m_Data        = data;
 }
Ejemplo n.º 5
0
 public object this[string name] => this[Spreadsheet.GetColumnID(name)];
Ejemplo n.º 6
0
 public DataRecord(Spreadsheet ss, object[] data)
 {
     Spreadsheet = ss;
     Data        = data;
 }