home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / freedraft.tar.gz / freedraft.tar / FREEdraft-050298 / CORE / selectionfilter.h < prev    next >
C/C++ Source or Header  |  1998-04-29  |  2KB  |  65 lines

  1. // selectionfilter.h
  2.  
  3. // Copyright (C) 1997  Cliff Johnson                                       //
  4. //                                                                         //
  5. // This program is free software; you can redistribute it and/or           //
  6. // modify it under the terms of the GNU  General Public                    //
  7. // License as published by the Free Software Foundation; either            //
  8. // version 2 of the License, or (at your option) any later version.        //
  9. //                                                                         //
  10. // This software is distributed in the hope that it will be useful,        //
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of          //
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       //
  13. // General Public License for more details.                                //
  14. //                                                                         //
  15. // You should have received a copy of the GNU General Public License       //
  16. // along with this software (see COPYING); if not, write to the        //
  17. // Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
  18.  
  19.  
  20.  
  21.  
  22. #ifndef SELECTIONFILTER_H
  23. #define SELECTIONFILTER_H
  24.  
  25. #include <iostream.h>
  26. #include <vector>
  27.  
  28. enum {
  29.     NUM_BUTTONS=8,
  30.     CLOSEST=1,
  31.     PRIORITY
  32.      };
  33.  
  34. class SelectionFilter
  35. {
  36.  
  37. private:
  38.     vector<int>entityTypes;
  39. //    int depth;
  40.     int criteria;
  41.  
  42. public:
  43.     SelectionFilter()  { }
  44. //    SelectionFilter(int crit, int d);    // selection with criteria
  45.  
  46.     SelectionFilter(const SelectionFilter& sf);
  47.     SelectionFilter& operator=(const SelectionFilter& sf);
  48.     friend bool operator==(const SelectionFilter& sf1, const SelectionFilter& sf2);
  49.  
  50.     friend bool operator==(int type, const SelectionFilter& sf); // is a type in the list.
  51.     friend bool operator==(const SelectionFilter& sf, int type);
  52.  
  53.     void SetCriteria(int i) { criteria = i; }
  54.  
  55.     void Add(int);
  56.     int operator[](unsigned int idx) const;
  57.     int Size() const ;
  58. //    int Depth() const { return depth; }
  59.     int Criteria() const { return criteria;}
  60.  
  61.     friend ostream& operator<<(ostream&, const SelectionFilter& sf);
  62. };
  63.  
  64. #endif
  65.