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

GitHub noreply at github.com
Mon Feb 19 23:59:35 UTC 2018


  Branch: refs/heads/code_cleanups
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 515dbdd96b5733e0a9db436ec5c3726cdd8af34a
      https://github.com/wesnoth/wesnoth/commit/515dbdd96b5733e0a9db436ec5c3726cdd8af34a
  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: 4ccb962cd0adf4f3afdd26da45904dfdedec7e35
      https://github.com/wesnoth/wesnoth/commit/4ccb962cd0adf4f3afdd26da45904dfdedec7e35
  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: dbedb67aa5fc9c02a0a08519bf2291bb262dcdb7
      https://github.com/wesnoth/wesnoth/commit/dbedb67aa5fc9c02a0a08519bf2291bb262dcdb7
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-02-20 (Tue, 20 Feb 2018)

  Changed paths:
    M src/editor/action/mouse/mouse_action_unit.cpp

  Log Message:
  -----------
  Fixup the loc array commit


  Commit: 7f7d4ab978e7c0c4f981c148e25b5bafa283a51f
      https://github.com/wesnoth/wesnoth/commit/7f7d4ab978e7c0c4f981c148e25b5bafa283a51f
  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 tuple comparison


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

  Changed paths:
    M src/config.hpp
    M src/display.hpp
    M src/gui/widgets/grid.hpp
    M src/image.hpp
    M src/sound_music_track.hpp
    M src/terrain/translation.hpp
    M src/variable.hpp
    M src/version.cpp

  Log Message:
  -----------
  [WIP] Implement various operators in terms of == or <

Includes some fixes for some != operators performing == in config.


Compare: https://github.com/wesnoth/wesnoth/compare/515dbdd96b57^...600dc9a9c904


More information about the Commits mailing list