mail[Wesnoth-commits] r43476 - in /trunk/src/whiteboard: manager.cpp manager.hpp visitor.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by gabrielmorin on June 16, 2010 - 03:03:
Author: gabba
Date: Wed Jun 16 03:03:01 2010
New Revision: 43476

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43476&view=rev
Log:
Whiteboard: minor refactoring, comments, cleanup

Modified:
    trunk/src/whiteboard/manager.cpp
    trunk/src/whiteboard/manager.hpp
    trunk/src/whiteboard/visitor.hpp

Modified: trunk/src/whiteboard/manager.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.cpp?rev=43476&r1=43475&r2=43476&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.cpp (original)
+++ trunk/src/whiteboard/manager.cpp Wed Jun 16 03:03:01 2010
@@ -32,7 +32,7 @@
 
 manager::manager():
                active_(false),
-               mapbuilder_(NULL),
+               mapbuilder_(),
                route_(),
                move_arrow_(),
                fake_unit_(),
@@ -128,6 +128,9 @@
        if (move_arrow_)
        {
                move_arrow_.reset(); //auto-removes itself from display
+       }
+       if (fake_unit_)
+       {
                resources::screen->remove_temporary_unit(fake_unit_.get());
                fake_unit_.reset();
        }

Modified: trunk/src/whiteboard/manager.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.hpp?rev=43476&r1=43475&r2=43476&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.hpp (original)
+++ trunk/src/whiteboard/manager.hpp Wed Jun 16 03:03:01 2010
@@ -23,8 +23,8 @@
 
 #include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
 
-#include <memory>
 #include <vector>
 
 class arrow;
@@ -57,6 +57,7 @@
        void apply_temp_modifiers();
        void remove_temp_modifiers();
 
+       /** Choose the target unit for action creation */
        void select_unit(unit& unit);
        void deselect_unit();
 
@@ -67,7 +68,7 @@
 
        /**
         * Creates a move action for the current side,
-        * and erases the stored route. The move is inserted
+        * and erases the temp move. The move action is inserted
         * at the end of the queue, to be executed last.
      */
        void save_temp_move();
@@ -78,7 +79,7 @@
         */
        bool active_;
 
-       std::auto_ptr<mapbuilder_visitor> mapbuilder_;
+       boost::scoped_ptr<mapbuilder_visitor> mapbuilder_;
 
        std::vector<map_location> route_;
 

Modified: trunk/src/whiteboard/visitor.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/visitor.hpp?rev=43476&r1=43475&r2=43476&view=diff
==============================================================================
--- trunk/src/whiteboard/visitor.hpp (original)
+++ trunk/src/whiteboard/visitor.hpp Wed Jun 16 03:03:01 2010
@@ -19,6 +19,7 @@
 #ifndef WB_VISITOR_HPP_
 #define WB_VISITOR_HPP_
 
+#include <boost/noncopyable.hpp>
 #include <boost/shared_ptr.hpp>
 
 namespace wb
@@ -27,7 +28,7 @@
 class action;
 class move;
 
-class visitor
+class visitor : private boost::noncopyable
 {
 public:
        visitor();




Related Messages


Powered by MHonArc, Updated Wed Jun 16 03:20:13 2010