]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Entity.hh
scene drawing correctly implemented; new classes
[chaz/yoink] / src / Moof / Entity.hh
similarity index 73%
rename from src/Moof/Profiler.hh
rename to src/Moof/Entity.hh
index 40199df3e27706404b9177bc31c122c5ed30d45c..738e13785b0f3d77bcb09580ce83288dc1d02ffe 100644 (file)
 
 *******************************************************************************/
 
-#ifndef _MOOF_PROFILER_HH_
-#define _MOOF_PROFILER_HH_
+#ifndef _MOOF_ENTITY_HH_
+#define _MOOF_ENTITY_HH_
 
-/**
- * @file Profiler.hh
- * Braindead-simple profiler.
- */
+#include <boost/shared_ptr.hpp>
 
-#include <ctime>
+#include <Moof/Aabb.hh>
+#include <Moof/Drawable.hh>
+#include <Moof/Cullable.hh>
 
 
 namespace Mf {
 
-class Profiler
-{      
+
+/**
+ * Interface for game objects that can be drawn to the screen and half a
+ * specified size.
+ */
+
+class Entity : public Drawable, public Cullable
+{
 public:
-       Profiler(const char* name = "")
-       {
-               start(name);
-       }
-       ~Profiler()
+       const Aabb& getAabb() const
        {
-               stop();
-       }
-       
-       void start(const char* name = "")
-       {
-               begin = std::clock();
-               std::cout << "Profiling " << name << "... ";
+               return aabb_;
        }
 
-       void stop()
-       {
-               if (begin == -1) return;
-               double elapsed = double(std::clock() - begin) / double(CLOCKS_PER_SEC);
-               std::cout << elapsed << " sec" << std::endl;
-               begin = -1;
-       }
+protected:
+       Aabb aabb_;
+};
 
-       void cancel()
-       {
-        begin = -1;
-    }
+typedef boost::shared_ptr<Entity> EntityPtr;
 
-private:
-       std::clock_t begin;
-};
 
 } // namespace Mf
 
-
-#endif // _MOOF_PROFILER_HH_
+#endif // _MOOF_ENTITY_HH_
 
 /** vim: set ts=4 sw=4 tw=80: *************************************************/
 
This page took 0.020086 seconds and 4 git commands to generate.