usata-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Usata-commits] Changes to usata2/src/object.hpp


From: David Lau
Subject: [Usata-commits] Changes to usata2/src/object.hpp
Date: Sun, 09 Jan 2005 04:53:11 -0500

Index: usata2/src/object.hpp
diff -u usata2/src/object.hpp:1.8 usata2/src/object.hpp:1.9
--- usata2/src/object.hpp:1.8   Fri Jan  7 06:13:11 2005
+++ usata2/src/object.hpp       Sun Jan  9 08:57:22 2005
@@ -10,7 +10,7 @@
 // included in the software distribution, or visit
 // http://www.fsf.org/licenses/gpl.html.
 //
-// $Id: object.hpp,v 1.8 2005/01/07 06:13:11 skunix Exp $
+// $Id: object.hpp,v 1.9 2005/01/09 08:57:22 skunix Exp $
 
 
 #ifndef USATA_GAME_OBJECT_HPP
@@ -19,7 +19,7 @@
 #include <boost/shared_ptr.hpp>
 #include <string>
 #include "usata.hpp"
-
+#include "exception_types.hpp"
 
 // these need to go somewhere else
 #define USATA_DRAW_ORDER_LAST  255
@@ -28,6 +28,28 @@
 
 namespace usata
 {
+       
+       namespace exceptions
+       {
+
+               class NodeException : public RecoverableError
+               {
+                       public:
+                       NodeException(const std::string& 
what):RecoverableError(what){}
+               };
+
+               class NodeMissingChild : public NodeException
+               {
+                       public:
+                               std::string child_name;
+                               std::string container_name;
+                       
+                               NodeMissingChild(const std::string& nn, const 
std::string& cn);
+
+                               virtual ~NodeMissingChild()throw(){}
+               };
+
+       }
 
        struct ResourceList
        {
@@ -60,23 +82,27 @@
                        static  std::string NodePathPop(std::string&);
                        virtual void add_child(const Object_sp&, std::string& 
path){};
                        virtual void add_child(const Object_sp&){};
+
                        virtual Object_sp get_child(const std::string&)=0;
+
                        virtual bool child_op(Node::ChildOp,Object*){return 
false;}
-                       virtual bool query(Node::Query, int& i){return false;}
+                       virtual bool node_query(Node::Query, int& i){return 
false;}
        };
 
        class Object
        {
                Object*         Parent;
                std::string Name;
+
                public:
+                       typedef enum Query { QUERY_STATE } Query;
                        virtual void    update(void) {};
                        virtual void    draw (void) {} ;
                        virtual                 ~Object(){};
                        Object():Parent(0){}
                        const std::string& name() const { return Name; }
                        void    name(const std::string&nn) {Name=nn;}
-                               
+                       virtual bool query(Query, int&){return false;}
                        virtual void parent(Object*o)
                        {
                                Parent = o;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]