[Commits] [wesnoth/wesnoth] ae53a3: Use std::array for adjacent map_location arrays

GitHub noreply at github.com
Tue Feb 20 01:11:32 UTC 2018


  Branch: refs/heads/code_cleanups
  Home:   https://github.com/wesnoth/wesnoth
  Commit: ae53a388354ed68e2c41ee060f29163d1a8a0b08
      https://github.com/wesnoth/wesnoth/commit/ae53a388354ed68e2c41ee060f29163d1a8a0b08
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-02-20 (Tue, 20 Feb 2018)

  Changed paths:
    M src/actions/attack.cpp
    M src/actions/move.cpp
    M src/actions/vision.cpp
    M src/ai/contexts.cpp
    M src/ai/default/aspect_attacks.cpp
    M src/ai/default/aspect_attacks.hpp
    M src/ai/default/attack.cpp
    M src/ai/default/ca.cpp
    M src/ai/default/ca_move_to_targets.cpp
    M src/ai/default/contexts.cpp
    M src/ai/formula/ai.cpp
    M src/ai/formula/callable_objects.cpp
    M src/ai/formula/function_table.cpp
    M src/display.cpp
    M src/display_context.cpp
    M src/editor/action/mouse/mouse_action_item.cpp
    M src/editor/action/mouse/mouse_action_unit.cpp
    M src/editor/map/editor_map.cpp
    M src/formula/function.cpp
    M src/formula/function_gamestate.cpp
    M src/generators/cave_map_generator.cpp
    M src/generators/default_map_generator_job.cpp
    M src/map/location.hpp
    M src/mouse_events.cpp
    M src/pathfind/astarsearch.cpp
    M src/pathfind/pathfind.cpp
    M src/pathutils.cpp
    M src/terrain/filter.cpp
    M src/tod_manager.cpp
    M src/units/abilities.cpp
    M src/units/filter.cpp
    M src/units/udisplay.cpp

  Log Message:
  -----------
  Use std::array for adjacent map_location arrays

I left the implementation of get_adjacent_tiles using messy C ptr arithmetic
since it most simply accounts for a few cases using arrays that are larger than
6 (such as in tod_manager) or underlying vector storage.

Also made use of std::array::size where applicable, and one case of std::array
iterators.

aspect_attacks_base::analyze_targets was changed to take a adjacent_loc_array_t
reference.


  Commit: a77652986a0b3df9a9f5cf7a454dbb3c9215a13d
      https://github.com/wesnoth/wesnoth/commit/a77652986a0b3df9a9f5cf7a454dbb3c9215a13d
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-02-20 (Tue, 20 Feb 2018)

  Changed paths:
    M src/actions/advancement.cpp
    M src/actions/move.cpp
    M src/ai/simulated_actions.cpp
    M src/config.cpp
    M src/display.cpp
    M src/editor/palette/location_palette.cpp
    M src/formula/formula.cpp
    M src/game_board.cpp
    M src/game_events/action_wml.cpp
    M src/game_initialization/connect_engine.cpp
    M src/game_initialization/flg_manager.cpp
    M src/game_initialization/singleplayer.cpp
    M src/gui/dialogs/addon/manager.cpp
    M src/gui/dialogs/campaign_selection.cpp
    M src/gui/dialogs/multiplayer/mp_create_game.cpp
    M src/gui/dialogs/multiplayer/mp_options_helper.cpp
    M src/gui/dialogs/preferences_dialog.cpp
    M src/gui/widgets/chatbox.cpp
    M src/gui/widgets/tree_view.cpp
    M src/menu_events.cpp
    M src/recall_list_manager.cpp
    M src/scripting/game_lua_kernel.cpp
    M src/server/metrics.cpp
    M src/server/server.cpp
    M src/server/simple_wml.cpp
    M src/whiteboard/side_actions.cpp

  Log Message:
  -----------
  Used std::distance instead of iterator arithmetic when possible


  Commit: ea4b67462b2a4766e66b2219f773d5ebb39ac2ee
      https://github.com/wesnoth/wesnoth/commit/ea4b67462b2a4766e66b2219f773d5ebb39ac2ee
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-02-20 (Tue, 20 Feb 2018)

  Changed paths:
    M src/font/font_id.hpp
    M src/gui/dialogs/multiplayer/mp_options_helper.hpp
    M src/gui/widgets/minimap.cpp
    M src/map/location.hpp
    M src/pathfind/pathfind.cpp
    M src/sdl/point.hpp
    M src/terrain/builder.hpp
    M src/terrain/translation.hpp

  Log Message:
  -----------
  Simplify some implementations of operator< using lexicographical tuple comparison

Might do operator== later too.


  Commit: b14fdc88a0d321cf0c37f7bfcf441ee82fea3f81
      https://github.com/wesnoth/wesnoth/commit/b14fdc88a0d321cf0c37f7bfcf441ee82fea3f81
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-02-20 (Tue, 20 Feb 2018)

  Changed paths:
    M src/config.hpp

  Log Message:
  -----------
  Config: fixed two cases of operator!= operating the same as operator==


Compare: https://github.com/wesnoth/wesnoth/compare/600dc9a9c904...b14fdc88a0d3


More information about the Commits mailing list