Author: anonymissimus
Date: Wed Jun  8 21:00:03 2011
New Revision: 49796

URL: http://svn.gna.org/viewcvs/wesnoth?rev=49796&view=rev
Log:
make one of the tod getters private and rename it

Modified:
    trunk/src/actions.cpp
    trunk/src/reports.cpp
    trunk/src/terrain_filter.cpp
    trunk/src/tod_manager.cpp
    trunk/src/tod_manager.hpp

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=49796&r1=49795&r2=49796&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Wed Jun  8 21:00:03 2011
@@ -2156,7 +2156,7 @@
 int combat_modifier(const map_location &loc,
        unit_type::ALIGNMENT alignment, bool is_fearless)
 {
-       const time_of_day &tod = resources::tod_manager->time_of_day_at(loc);
+       const time_of_day &tod = resources::tod_manager->get_time_of_day(0, 
loc, true);
 
        int bonus;
        int lawful_bonus = tod.lawful_bonus;

Modified: trunk/src/reports.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/reports.cpp?rev=49796&r1=49795&r2=49796&view=diff
==============================================================================
--- trunk/src/reports.cpp (original)
+++ trunk/src/reports.cpp Wed Jun  8 21:00:03 2011
@@ -590,7 +590,7 @@
                // Don't show illuminated time on fogged tiles.
                tod = 
resources::tod_manager->get_time_of_day_with_areas(mouseover_hex);
        } else {
-               tod = resources::tod_manager->time_of_day_at(mouseover_hex);
+               tod = resources::tod_manager->get_time_of_day(0, mouseover_hex, 
true);
        }
 
        int b = tod.lawful_bonus;

Modified: trunk/src/terrain_filter.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/terrain_filter.cpp?rev=49796&r1=49795&r2=49796&view=diff
==============================================================================
--- trunk/src/terrain_filter.cpp (original)
+++ trunk/src/terrain_filter.cpp Wed Jun  8 21:00:03 2011
@@ -214,7 +214,7 @@
                if(flat_) {
                        tod = 
resources::tod_manager->get_time_of_day_with_areas(loc);
                } else {
-                       tod = resources::tod_manager->time_of_day_at(loc);
+                       tod = resources::tod_manager->get_time_of_day(0, loc, 
true);
                }
        }
        if(!tod_type.empty()) {

Modified: trunk/src/tod_manager.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tod_manager.cpp?rev=49796&r1=49795&r2=49796&view=diff
==============================================================================
--- trunk/src/tod_manager.cpp (original)
+++ trunk/src/tod_manager.cpp Wed Jun  8 21:00:03 2011
@@ -99,8 +99,7 @@
 {
        if(for_turn == 0) for_turn = turn_;
        if(consider_illuminates) {
-               assert(resources::game_map->on_board(loc));
-               return time_of_day_at(loc, for_turn);
+               return get_time_of_day_with_areas_and_units(loc, for_turn);
        }
        if(!resources::game_map->on_board(loc)) {
                return get_time_of_day_turn(times_, for_turn, currentTime_);
@@ -218,7 +217,7 @@
        return times[time];
 }
 
-time_of_day tod_manager::time_of_day_at(const map_location& loc, const int 
for_turn) const
+time_of_day tod_manager::get_time_of_day_with_areas_and_units(const 
map_location& loc, const int for_turn) const
 {
        const gamemap& map = *resources::game_map;
        const unit_map& units = *resources::units;

Modified: trunk/src/tod_manager.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tod_manager.hpp?rev=49796&r1=49795&r2=49796&view=diff
==============================================================================
--- trunk/src/tod_manager.hpp (original)
+++ trunk/src/tod_manager.hpp Wed Jun  8 21:00:03 2011
@@ -37,7 +37,6 @@
                 * for_turn = 0 means current turn
                 * if loc is on board then tod areas matter (else: scenario 
main time)
                 * if consider_illuminates then tod modifying units matter in 
addition to time areas
-                * loc must be on board if consider_illuminates
                 */
                const time_of_day get_time_of_day(int for_turn = 0, const 
map_location loc = map_location(), const bool consider_illuminates = false) 
const;
                const time_of_day& get_previous_time_of_day() const;
@@ -89,9 +88,6 @@
 
                const std::vector<time_of_day> times() const {return times_;}
 
-               //consider tod modifying units (e.g. illuminates)
-               time_of_day time_of_day_at(const map_location& loc, const int 
for_turn = 0) const;
-
                //turn functions
                int turn() const { return turn_; }
                int number_of_turns() const {return num_turns_;}
@@ -123,6 +119,9 @@
                 * Correct time is calculated from current time.
                 */
                const time_of_day& get_time_of_day_turn(const 
std::vector<time_of_day>& times, int nturn, const int current_time) const;
+
+               //consider tod modifying units (e.g. illuminates)
+               time_of_day get_time_of_day_with_areas_and_units(const 
map_location& loc, const int for_turn = 0) const;
 
                /**
                 * Computes for the main time or a time area the index of its 
times where we're currently at.


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to