Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InitRecords()

void System.Data.Index.InitRecords ( IFilter filter)
inlineprivate

Definition at line 634 of file Index.cs.

635 {
636 DataViewRowState recordStates = _recordStates;
637 bool append = _indexFields.Length == 0;
638 _records = new IndexTree(this);
639 _recordCount = 0;
640 foreach (DataRow row in _table.Rows)
641 {
642 int num = -1;
643 if (row._oldRecord == row._newRecord)
644 {
645 if ((recordStates & DataViewRowState.Unchanged) != 0)
646 {
647 num = row._oldRecord;
648 }
649 }
650 else if (row._oldRecord == -1)
651 {
652 if ((recordStates & DataViewRowState.Added) != 0)
653 {
654 num = row._newRecord;
655 }
656 }
657 else if (row._newRecord == -1)
658 {
659 if ((recordStates & DataViewRowState.Deleted) != 0)
660 {
661 num = row._oldRecord;
662 }
663 }
664 else if ((recordStates & DataViewRowState.ModifiedCurrent) != 0)
665 {
666 num = row._newRecord;
667 }
668 else if ((recordStates & DataViewRowState.ModifiedOriginal) != 0)
669 {
670 num = row._oldRecord;
671 }
672 if (num != -1 && AcceptRecord(num, filter))
673 {
674 _records.InsertAt(-1, num, append);
675 _recordCount++;
676 }
677 }
678 }
DataRowCollection Rows
Definition DataTable.cs:701
bool AcceptRecord(int record)
Definition Index.cs:153
readonly DataViewRowState _recordStates
Definition Index.cs:38
readonly DataTable _table
Definition Index.cs:32
IndexTree _records
Definition Index.cs:42
int InsertAt(int position, K item, bool append)
Definition RBTree.cs:1262

References System.Data.Index._recordCount, System.Data.Index._records, System.Data.Index._recordStates, System.Data.Index._table, System.Data.Index.AcceptRecord(), System.Data.RBTree< K >.InsertAt(), and System.Data.DataTable.Rows.

Referenced by System.Data.Index.Index(), and System.Data.Index.Reset().