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


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

Header


Content

Posted by gabrielmorin on July 20, 2010 - 09:51:
Author: gabba
Date: Tue Jul 20 09:51:46 2010
New Revision: 44417

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44417&view=rev
Log:
Whiteboard: manager::validate_viewer_actions new method.

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

Modified: trunk/src/whiteboard/manager.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.cpp?rev=44417&r1=44416&r2=44417&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.cpp (original)
+++ trunk/src/whiteboard/manager.cpp Tue Jul 20 09:51:46 2010
@@ -81,7 +81,7 @@
 
        if (active_)
        {
-               viewer_actions()->validate_actions();
+               validate_viewer_actions();
                LOG_WB << *viewer_actions() << "\n";
                create_temp_move();
        }
@@ -135,7 +135,7 @@
 {
        if (active_)
        {
-                       viewer_actions()->validate_actions();
+                       validate_viewer_actions();
                        highlighter_.reset(new 
highlight_visitor(*resources::units, viewer_actions()));
        }
 
@@ -151,6 +151,13 @@
 
 }
 
+void manager::validate_viewer_actions()
+{
+       modifying_actions_ = true;
+       viewer_actions()->validate_actions();
+       modifying_actions_ = false;
+}
+
 void manager::set_planned_unit_map()
 {
        if (!modifying_actions_ && !wait_for_side_init_)
@@ -158,7 +165,7 @@
                modifying_actions_ = true;
                if (!planned_unit_map_active_)
                {
-                       viewer_actions()->validate_actions();
+                       validate_viewer_actions();
                        DBG_WB << "Building planned unit map.\n";
                        mapbuilder_.reset(new 
mapbuilder_visitor(*resources::units, viewer_actions()));
                        mapbuilder_->build_map();
@@ -396,7 +403,7 @@
                        && resources::controller->current_side() == 
resources::screen->viewing_side())
        {
                erase_temp_move();
-               viewer_actions()->validate_actions();
+               validate_viewer_actions();
 
                action_ptr action;
                side_actions::iterator it;
@@ -428,7 +435,7 @@
        if (!(modifying_actions_ || viewer_actions()->empty()))
        {
                erase_temp_move();
-               viewer_actions()->validate_actions();
+               validate_viewer_actions();
 
                action_ptr action;
                side_actions::iterator it;
@@ -460,7 +467,7 @@
        if (!(modifying_actions_ || viewer_actions()->empty()) && 
highlighter_)
        {
 
-               viewer_actions()->validate_actions();
+               validate_viewer_actions();
                action_ptr action = highlighter_->get_bump_target();
                if (action)
                {
@@ -476,7 +483,7 @@
        if (!(modifying_actions_ || viewer_actions()->empty()) && 
highlighter_)
        {
 
-               viewer_actions()->validate_actions();
+               validate_viewer_actions();
 
                action_ptr action = highlighter_->get_bump_target();
                if (action)

Modified: trunk/src/whiteboard/manager.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.hpp?rev=44417&r1=44416&r2=44417&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.hpp (original)
+++ trunk/src/whiteboard/manager.hpp Tue Jul 20 09:51:46 2010
@@ -58,6 +58,8 @@
 
        void on_init_side();
        void on_finish_side_turn();
+
+       void validate_viewer_actions();
 
        /**
         * Temporarily apply the effects of the current team's




Related Messages


Powered by MHonArc, Updated Tue Jul 20 10:00:13 2010