00001 /* 00002 * selection.h 00003 * 00004 * Created on: Jan 24, 2012 00005 * Author: sushil 00006 */ 00007 00008 #ifndef SELECTION_H_ 00009 #define SELECTION_H_ 00010 00011 #include <const.h> 00012 #include <ent.h> 00013 #include <entHelpers.h> 00014 #include <mgr.h> 00015 #include <options.h> 00016 00017 #include <map> 00018 00019 namespace FastEcslent { 00020 00021 class Engine; 00022 00023 00024 00025 class SelectionMgr : public Mgr { 00026 00027 private: 00028 void updatePrimarySelection(); 00029 Entity * selectedEntsArray[MaxEnts]; 00030 int nSelectedEnts; 00031 00032 public: 00033 std::map <Identity, Entity *, EntityLessThan> selectedEnts; // MaxEnts in const.h 00034 00035 Options options; 00036 Entity* primarySelection; 00037 00038 // All mgrs 00039 SelectionMgr(Engine *eng, Options opts); 00040 SelectionMgr(); 00041 void init(); 00042 void tick(double dtime); 00043 00044 00045 // selection 00046 void reset(); // set selected ents to unselected, update nSelectedEnts 00047 void resetAll(); // set all ents to unselected 00048 00049 void unselect(int i); 00050 void unselect(Entity *ent); 00051 void select(int i); 00052 void select(Entity *ent); 00053 void dump(); 00054 00055 Entity* getPrimarySelection(); 00056 Entity** getSelectedEnts(); 00057 int getNSelectedEnts(); 00058 00059 }; 00060 00061 } 00062 00063 00064 00065 00066 00067 #endif /* SELECTION_H_ */