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


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

Header


Content

Posted by gabrielmorin on July 14, 2010 - 05:37:
Author: gabba
Date: Wed Jul 14 05:37:24 2010
New Revision: 44158

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44158&view=rev
Log:
Whiteboard: validate actions of the current team whenever whiteboard gets 
activated. Still need to write the activation logic in play_controller.

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

Modified: trunk/src/whiteboard/manager.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.cpp?rev=44158&r1=44157&r2=44158&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.cpp (original)
+++ trunk/src/whiteboard/manager.cpp Wed Jul 14 05:37:24 2010
@@ -67,6 +67,14 @@
 {
 }
 
+void manager::set_active(bool active)
+{
+       active_ = active;
+
+       if (active_)
+               current_actions()->validate_actions();
+}
+
 void manager::set_planned_unit_map()
 {
        if (active_ && !modifying_actions_)

Modified: trunk/src/whiteboard/manager.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.hpp?rev=44158&r1=44157&r2=44158&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.hpp (original)
+++ trunk/src/whiteboard/manager.hpp Wed Jul 14 05:37:24 2010
@@ -51,7 +51,7 @@
         * Determine whether the whiteboard is activated.
         */
        bool is_active() const { return active_; }
-       void set_active(bool active){ active_ = active; }
+       void set_active(bool active);
 
        /**
         * Temporarily apply the effects of the current team's

Modified: trunk/src/whiteboard/validate_visitor.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/validate_visitor.cpp?rev=44158&r1=44157&r2=44158&view=diff
==============================================================================
--- trunk/src/whiteboard/validate_visitor.cpp (original)
+++ trunk/src/whiteboard/validate_visitor.cpp Wed Jul 14 05:37:24 2010
@@ -74,6 +74,8 @@
        if (!(move->source_hex_.valid() && move->dest_hex_.valid()))
                valid = false;
 
+       //TODO: need to check if the unit in the source hex has the same 
underlying unit id as before,
+       //i.e. that it's the same unit
        if (valid && resources::units->find(move->source_hex_) == 
resources::units->end())
                valid = false;
 




Related Messages


Powered by MHonArc, Updated Wed Jul 14 08:00:35 2010