AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
AuctionSorter Class Reference

#include "AuctionHouseSearcher.h"

Public Member Functions

 AuctionSorter (AuctionSortOrderVector const *sort, int loc_idx)
 
bool operator() (SearchableAuctionEntry const *auc1, SearchableAuctionEntry const *auc2) const
 

Private Attributes

AuctionSortOrderVector const * _sort
 
int _loc_idx
 

Detailed Description

Constructor & Destructor Documentation

◆ AuctionSorter()

AuctionSorter::AuctionSorter ( AuctionSortOrderVector const *  sort,
int  loc_idx 
)
inline
235: _sort(sort), _loc_idx(loc_idx) {}
int _loc_idx
Definition AuctionHouseSearcher.h:240
AuctionSortOrderVector const * _sort
Definition AuctionHouseSearcher.h:239

Member Function Documentation

◆ operator()()

bool AuctionSorter::operator() ( SearchableAuctionEntry const *  auc1,
SearchableAuctionEntry const *  auc2 
) const
645{
646 if (_sort->empty()) // not sorted
647 return false;
648
649 for (AuctionSortOrderVector::const_iterator itr = _sort->begin(); itr != _sort->end(); ++itr)
650 {
651 int res = auc1->CompareAuctionEntry(itr->sortOrder, *auc2, _loc_idx);
652 // "equal" by used column
653 if (res == 0)
654 continue;
655 // less/greater and normal/reversed ordered
656 return (res < 0) == itr->isDesc;
657 }
658
659 return false; // "equal" by all sorts
660}

References _loc_idx, _sort, and SearchableAuctionEntry::CompareAuctionEntry().

Member Data Documentation

◆ _loc_idx

int AuctionSorter::_loc_idx
private

Referenced by operator()().

◆ _sort

AuctionSortOrderVector const* AuctionSorter::_sort
private

Referenced by operator()().


The documentation for this class was generated from the following files: