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;
                }
            }
        }
        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;
                }
            }
        }
        private static 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");

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

                foreach (int itemID in tileCIDs.Select(v => record.GetInt32(v)))
                {
                    if (itemID > 0 && itemID < table.Length)
                    {
                        table[itemID] = fid;
                    }
                }
            }
        }
        private static 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 (var i = 0; i < ss.Records.Length; i++)
            {
                DataRecord record = ss.Records[i];

                int fid = record.GetInt32(featureCID);

                for (var index = 0; index < tileCIDs.Length; index++)
                {
                    var v = tileCIDs[index];

                    int itemID = record.GetInt32(v);

                    if (itemID > 0 && itemID < table.Length)
                    {
                        table[itemID] = fid;
                    }
                }
            }
        }
        private 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");

            for (var i = 0; i < ss.Records.Length; ++i)
            {
                var record = ss.Records[i];

                var fid = record.GetInt32(featureCID);

                for (var j = 0; j < tileCIDs.Length; ++j)
                {
                    var 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)]);
     }
 }
Beispiel #7
0
        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;
                }
            }
        }
Beispiel #8
0
 public object this[string name] => this[m_Spreadsheet.GetColumnID(name)];
		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;
				}
			}
		}