mail[Wesnoth-commits] r44511 - in /trunk/src/whiteboard: action.cpp action.hpp attack.cpp attack.hpp manager.cpp move.cpp move.hpp


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

Header


Content

Posted by gabrielmorin on July 22, 2010 - 02:32:
Author: gabba
Date: Thu Jul 22 02:32:08 2010
New Revision: 44511

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44511&view=rev
Log:
Whiteboard: transform move/attack to use pathfind::marked_route internally, 
step 3.

Modified:
    trunk/src/whiteboard/action.cpp
    trunk/src/whiteboard/action.hpp
    trunk/src/whiteboard/attack.cpp
    trunk/src/whiteboard/attack.hpp
    trunk/src/whiteboard/manager.cpp
    trunk/src/whiteboard/move.cpp
    trunk/src/whiteboard/move.hpp

Modified: trunk/src/whiteboard/action.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/action.cpp?rev=44511&r1=44510&r2=44511&view=diff
==============================================================================
--- trunk/src/whiteboard/action.cpp (original)
+++ trunk/src/whiteboard/action.cpp Thu Jul 22 02:32:08 2010
@@ -20,7 +20,7 @@
 
 namespace wb {
 
-std::ostream& operator<<(std::ostream& s, action_const_ptr action)
+std::ostream& operator<<(std::ostream& s, action_ptr action)
 {
        return action->print(s);
 }

Modified: trunk/src/whiteboard/action.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/action.hpp?rev=44511&r1=44510&r2=44511&view=diff
==============================================================================
--- trunk/src/whiteboard/action.hpp (original)
+++ trunk/src/whiteboard/action.hpp Thu Jul 22 02:32:08 2010
@@ -33,7 +33,7 @@
 public:
        friend class validate_visitor;
        friend class highlight_visitor;
-       friend std::ostream& operator<<(std::ostream& s, action_const_ptr 
action);
+       friend std::ostream& operator<<(std::ostream& s, action_ptr action);
 
        action();
        virtual ~action();
@@ -69,7 +69,7 @@
        virtual bool is_valid() = 0;
 };
 
-std::ostream& operator<<(std::ostream& s, wb::action const& action);
+std::ostream& operator<<(std::ostream& s, action_ptr action);
 
 } // end namespace wb
 

Modified: trunk/src/whiteboard/attack.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/attack.cpp?rev=44511&r1=44510&r2=44511&view=diff
==============================================================================
--- trunk/src/whiteboard/attack.cpp (original)
+++ trunk/src/whiteboard/attack.cpp Thu Jul 22 02:32:08 2010
@@ -29,7 +29,7 @@
 namespace wb
 {
 
-std::ostream &operator<<(std::ostream &s, attack_const_ptr attack)
+std::ostream &operator<<(std::ostream &s, attack_ptr attack)
 {
 //     s << "Attack for unit " << attack->get_unit().name() << " [" << 
attack->get_unit().underlying_id() << "] "
 //                     << "moving from (" << attack->get_source_hex() << ") 
to (" << attack->get_dest_hex() << ") and attacking "

Modified: trunk/src/whiteboard/attack.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/attack.hpp?rev=44511&r1=44510&r2=44511&view=diff
==============================================================================
--- trunk/src/whiteboard/attack.hpp (original)
+++ trunk/src/whiteboard/attack.hpp Thu Jul 22 02:32:08 2010
@@ -33,7 +33,7 @@
 public:
        friend class validate_visitor;
        friend class highlight_visitor;
-       friend std::ostream& operator<<(std::ostream& s, attack_const_ptr 
attack);
+       friend std::ostream& operator<<(std::ostream& s, attack_ptr attack);
 
        ///Future unit map must be valid during construction, so that attack 
can find its units
        attack(const map_location& target_hex, int weapon_choice, const 
pathfind::marked_route& route,
@@ -59,7 +59,7 @@
 };
 
 /** Dumps an attack on a stream, for debug purposes. */
-std::ostream& operator<<(std::ostream &s, wb::attack const& attack);
+std::ostream& operator<<(std::ostream &s, attack_ptr attack);
 
 } // end namespace wb
 

Modified: trunk/src/whiteboard/manager.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/manager.cpp?rev=44511&r1=44510&r2=44511&view=diff
==============================================================================
--- trunk/src/whiteboard/manager.cpp (original)
+++ trunk/src/whiteboard/manager.cpp Thu Jul 22 02:32:08 2010
@@ -344,10 +344,9 @@
                move_arrow = arrow_ptr(move_arrow_);
                fake_unit = fake_unit_ptr(fake_unit_);
 
-               on_deselect_hex();
-
                fake_unit->set_disabled_ghosted(false);
                viewer_actions()->queue_move(*route_, move_arrow, fake_unit);
+               on_deselect_hex();
        }
 }
 
@@ -355,7 +354,6 @@
 {
        if (active_ && !executing_actions_)
        {
-               std::vector<map_location> steps;
                arrow_ptr move_arrow;
                fake_unit_ptr fake_unit;
 
@@ -376,8 +374,6 @@
                        source_hex = attack_from;
                }
 
-               on_deselect_hex();
-
                unit* attacking_unit = find_future_unit(source_hex);
                assert(attacking_unit);
 
@@ -391,6 +387,7 @@
                }
 
                resources::screen->invalidate(target_hex);
+               on_deselect_hex();
        }
 }
 

Modified: trunk/src/whiteboard/move.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/move.cpp?rev=44511&r1=44510&r2=44511&view=diff
==============================================================================
--- trunk/src/whiteboard/move.cpp (original)
+++ trunk/src/whiteboard/move.cpp Thu Jul 22 02:32:08 2010
@@ -36,7 +36,7 @@
 
 namespace wb {
 
-std::ostream& operator<<(std::ostream &s, move_const_ptr move)
+std::ostream& operator<<(std::ostream &s, move_ptr move)
 {
        return move->print(s);
 }

Modified: trunk/src/whiteboard/move.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/move.hpp?rev=44511&r1=44510&r2=44511&view=diff
==============================================================================
--- trunk/src/whiteboard/move.hpp (original)
+++ trunk/src/whiteboard/move.hpp Thu Jul 22 02:32:08 2010
@@ -34,7 +34,7 @@
 public:
        friend class validate_visitor;
        friend class highlight_visitor;
-       friend std::ostream& operator<<(std::ostream& s, move_const_ptr move);
+       friend std::ostream& operator<<(std::ostream& s, move_ptr move);
 
        static const double ALPHA_HIGHLIGHT;
        static const double ALPHA_NORMAL;
@@ -88,7 +88,7 @@
 };
 
 /** Dumps an move on a stream, for debug purposes. */
-std::ostream &operator<<(std::ostream &s, wb::move const& move);
+std::ostream &operator<<(std::ostream &s, move_ptr move);
 
 } // end namespace wb
 




Related Messages


Powered by MHonArc, Updated Thu Jul 22 02:40:14 2010