random_racer/src/ItemDistributor.h

Go to the documentation of this file.
00001 #ifndef _ITEMDISTRIBUTOR_H_
00002 #define _ITEMDISTRIBUTOR_H_
00003 
00004 #include <vector>
00005 #include <list>
00006 
00007 #include <vrs/sg/scenething.h>
00008 #include <vrs/sharedobj.h>
00009 #include <vrs/vector.h>
00010 
00011 #include "CollectableCoin.h"
00012 
00013 namespace random_racer
00014 {
00015 
00016 class VRSTerrainLoader;
00017 class CenterScreenDisplay;
00018 
00022 class ItemDistributor : public VRS::SharedObj
00023 {
00024     std::list<VRS::SO<CollectableCoin> > m_coins;
00025 
00026     VRS::SO<VRS::SceneThing> m_parent;
00027     VRS::SO<VRSTerrainLoader> m_loader;
00028     VRS::SO<CenterScreenDisplay> m_display;
00029     unsigned int m_maxItems, m_score;
00030     bool m_enabled, m_superCoinCreated;
00031 
00032 public:
00037     ItemDistributor(
00038         VRS::SO<VRS::SceneThing> parent,
00039         VRS::SO<VRSTerrainLoader> vrsLoader,
00040         VRS::SO<CenterScreenDisplay> centerScreenDisplay);
00041 
00045     virtual ~ItemDistributor ();
00046     
00053     void distributeItems(unsigned int count, VRS::Vector around, double radius);
00054 
00058     void removeAllItems();
00059     
00063     void rotateItems(double);
00064     
00068     void relocateItem(VRS::SO<CollectableCoin>);
00069     
00073     void destroyItem(VRS::SO<CollectableCoin>);
00074     
00079     void checkForCollisionsAndRotate(double angle);
00080 
00084     void setEnabled(bool enabled = true);
00085 
00086 protected:
00090     VRS::Vector randomPosition(
00091             double radius, VRS::Vector basePosition = VRS::Vector(0,0,0));
00092     
00096     double randomNumber();
00097 };
00098 
00099 }
00100 
00101 #endif /* _ITEMDISTRIBUTOR_H_ */

Generated on Fri May 11 21:01:57 2007 for Random Racer by  doxygen 1.5.1