[wesnoth-commits] [wesnoth/wesnoth] 7e442c: Units: refactor display_context parameter out of a...

GitHub noreply at github.com
Fri Apr 20 05:06:59 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 7e442cbb541b0bfbc5f3511fd1510fea80a4d34e
      https://github.com/wesnoth/wesnoth/commit/7e442cbb541b0bfbc5f3511fd1510fea80a4d34e
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-04-20 (Fri, 20 Apr 2018)

  Changed paths:
    M src/actions/create.cpp
    M src/actions/heal.cpp
    M src/actions/move.cpp
    M src/actions/vision.cpp
    M src/ai/composite/goal.cpp
    M src/ai/contexts.cpp
    M src/ai/default/aspect_attacks.cpp
    M src/ai/default/ca.cpp
    M src/ai/default/contexts.cpp
    M src/ai/formula/callable_objects.cpp
    M src/ai/formula/candidates.cpp
    M src/display_context.cpp
    M src/game_board.cpp
    M src/gui/dialogs/unit_list.cpp
    M src/menu_events.cpp
    M src/minimap.cpp
    M src/mouse_events.cpp
    M src/pathfind/pathfind.cpp
    M src/pathfind/teleport.cpp
    M src/play_controller.cpp
    M src/reports.cpp
    M src/scripting/game_lua_kernel.cpp
    M src/tod_manager.cpp
    M src/units/abilities.cpp
    M src/units/drawer.cpp
    M src/units/filter.cpp
    M src/units/udisplay.cpp
    M src/units/unit.cpp
    M src/units/unit.hpp
    M src/whiteboard/mapbuilder.cpp

  Log Message:
  -----------
  Units: refactor display_context parameter out of ability functions

This was essentially only needed for the affects_side() helper. THAT'S IT. All this code just for
one single line... Anyway...

Utilized the display singleton's display_context getter instead. This also means fewer explicit
uses of resources::gameboard as the display_context object, meaning more compatibility with the
editor (not that that's relevant for most of the changed usecases, such as the AI, but it does
affect unit::get_abilities, which might be useful there in the future).

This also removes the display_context parameter from unit::invisible() since it was only passed to
unit::get_ability_bool().

unit::is_visible_to_team() also had its display_context parameter removed. It was used once as an
argument for invisible() and the other case was replaced with display::get_map().




More information about the Commits mailing list