[Commits] [wesnoth/wesnoth] 16938d: add game_data::get_variable_accesss method.

GitHub noreply at github.com
Sat Jul 5 01:37:28 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 16938d397d848d2ff107fec9a3bdd03f84f62ee4
      https://github.com/wesnoth/wesnoth/commit/16938d397d848d2ff107fec9a3bdd03f84f62ee4
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/game_data.cpp
    M src/game_data.hpp
    M src/game_events/action_wml.cpp
    M src/scripting/lua.cpp
    M src/terrain_filter.cpp
    M src/unit.cpp
    M src/variable.cpp
    M src/variable.hpp

  Log Message:
  -----------
  add game_data::get_variable_accesss method.


  Commit: 5d3040c0b89e8b0f01cbe0c645f490b98c6fdb57
      https://github.com/wesnoth/wesnoth/commit/5d3040c0b89e8b0f01cbe0c645f490b98c6fdb57
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/CMakeLists.txt
    M src/SConscript
    M src/game_data.cpp
    M src/game_data.hpp
    M src/variable.cpp
    M src/variable.hpp
    A src/variable_info.cpp
    A src/variable_info.hpp

  Log Message:
  -----------
  move variable_info to own file

and also move game_data::temporarites_ to that file as a static
variable.

This fixes variable_info being dependent on game_data.


  Commit: 2fb6308929896ca1a7ad8a4070b4ccb495348bd2
      https://github.com/wesnoth/wesnoth/commit/2fb6308929896ca1a7ad8a4070b4ccb495348bd2
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/game_events/action_wml.cpp
    M src/variable_info.cpp
    M src/variable_info.hpp

  Log Message:
  -----------
  move partly [set_variables] code to variable_info class


  Commit: eb9ef2d16e8a0e2765fa6ef0b6ddbf0792939f60
      https://github.com/wesnoth/wesnoth/commit/eb9ef2d16e8a0e2765fa6ef0b6ddbf0792939f60
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/game_data.cpp
    M src/variable_info.cpp
    M src/variable_info.hpp

  Log Message:
  -----------
  add variable_info::clear method

move code from game_data

the plan is to make variable_info s member private.


  Commit: ac88831e9822dbbf21eb1fb25cbb49464799287e
      https://github.com/wesnoth/wesnoth/commit/ac88831e9822dbbf21eb1fb25cbb49464799287e
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/game_data.cpp
    M src/variable_info.cpp
    M src/variable_info.hpp

  Log Message:
  -----------
  add method variable_info::as_scalar_const


  Commit: ff70a7da836f4e3e0d6665e732aa0b5857144604
      https://github.com/wesnoth/wesnoth/commit/ff70a7da836f4e3e0d6665e732aa0b5857144604
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/game_data.cpp
    M src/variable_info.cpp
    M src/variable_info.hpp

  Log Message:
  -----------
  add variable_info::add_child method


  Commit: 4c324f3c0974a9b87dd724a28381d902212d5b25
      https://github.com/wesnoth/wesnoth/commit/4c324f3c0974a9b87dd724a28381d902212d5b25
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/unit.cpp
    M src/variable_info.cpp
    M src/variable_info.hpp

  Log Message:
  -----------
  add variable_info::as_array_throw method


  Commit: 450735090e786c89beca7eabdbc9ef5312be623c
      https://github.com/wesnoth/wesnoth/commit/450735090e786c89beca7eabdbc9ef5312be623c
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/game_data.hpp
    M src/game_events/action_wml.cpp
    M src/scripting/lua.cpp
    M src/terrain_filter.cpp
    M src/variable.cpp
    M src/variable_info.hpp

  Log Message:
  -----------
  make variable_info members private


  Commit: c366acb96e7395b00b9dea8bb32c1f4397d3a8c4
      https://github.com/wesnoth/wesnoth/commit/c366acb96e7395b00b9dea8bb32c1f4397d3a8c4
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/game_data.cpp
    M src/game_data.hpp
    M src/game_events/action_wml.cpp
    M src/scripting/lua.cpp
    M src/terrain_filter.cpp
    M src/unit.cpp
    M src/variable.cpp

  Log Message:
  -----------
  make different functions for different variable access

the const_cast there is an improvement of the previous solution where we
just hided it by using resources::gamedata which is never const.


  Commit: 5110a87a2fcf93e9231ea81de2023758f31be682
      https://github.com/wesnoth/wesnoth/commit/5110a87a2fcf93e9231ea81de2023758f31be682
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/variable.hpp

  Log Message:
  -----------
  add comment about [insert_tag]


  Commit: 23b0c5343f0d8444635586cf3318e7221e815841
      https://github.com/wesnoth/wesnoth/commit/23b0c5343f0d8444635586cf3318e7221e815841
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-06-30 (Mon, 30 Jun 2014)

  Changed paths:
    M src/game_data.cpp
    M src/game_events/action_wml.cpp
    M src/menu_events.cpp
    M src/persist_var.cpp
    M src/scripting/lua.cpp
    M src/synced_commands.cpp
    M src/variable.cpp

  Log Message:
  -----------
  catch invalid variablename exception when using

these exceptiosn are not thrown yet in all cases. This patch prepares a
patch taht makes use of it.


  Commit: 1a8d3c6fa22da471b04090eb8b211e5cdf03d2f3
      https://github.com/wesnoth/wesnoth/commit/1a8d3c6fa22da471b04090eb8b211e5cdf03d2f3
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M src/game_data.cpp
    M src/game_data.hpp
    M src/game_events/action_wml.cpp
    M src/menu_events.cpp
    M src/persist_var.cpp
    M src/scripting/lua.cpp
    M src/synced_commands.cpp
    M src/terrain_filter.cpp
    M src/unit.cpp
    M src/variable.cpp
    M src/variable_info.cpp
    M src/variable_info.hpp
    A src/variable_info_detail.hpp

  Log Message:
  -----------
  refactor variable_info

we now use const correctness to ensure that we sont change teh game
config if we just want to read values.

Also we use a new algorithm that is a little slower when parsing small
variablenames and much faster when parsing long variablenames.


  Commit: 7f5985fbc21ea5622465fbdd0744373aaf9ef282
      https://github.com/wesnoth/wesnoth/commit/7f5985fbc21ea5622465fbdd0744373aaf9ef282
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M src/variable_info.cpp

  Log Message:
  -----------
  fixup build

the previous version only worked in msvc which has a nonstandard two phase lookup implementaion.


  Commit: 3a711de58c0f9c276cfe5608837a9ecafa6194d1
      https://github.com/wesnoth/wesnoth/commit/3a711de58c0f9c276cfe5608837a9ecafa6194d1
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M src/variable_info.cpp

  Log Message:
  -----------
  fixup build

we have to use this-> in templatd classes the derive from other template
classes


  Commit: 929d70ba8d82582da64f067ec65f5559b27f9e94
      https://github.com/wesnoth/wesnoth/commit/929d70ba8d82582da64f067ec65f5559b27f9e94
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-01 (Tue, 01 Jul 2014)

  Changed paths:
    M src/variable_info.cpp

  Log Message:
  -----------
  fixup build

we need to put the explicit instantiation after the definition


  Commit: fda3beb544a37ff6270bd7fdabfc0255abc7b8b3
      https://github.com/wesnoth/wesnoth/commit/fda3beb544a37ff6270bd7fdabfc0255abc7b8b3
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-02 (Wed, 02 Jul 2014)

  Changed paths:
    M src/variable_info.cpp
    M src/variable_info.hpp
    M src/variable_info_detail.hpp

  Log Message:
  -----------
  add comments in variable_info


  Commit: cf6fcfbd836fcba95521635be1778bd9e4d31ac6
      https://github.com/wesnoth/wesnoth/commit/cf6fcfbd836fcba95521635be1778bd9e4d31ac6
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-02 (Wed, 02 Jul 2014)

  Changed paths:
    M src/variable_info.cpp

  Log Message:
  -----------
  optimize variable_info

we now don't  check for '.', '[', ']' twice.


  Commit: 304d3dac790759db4ad7a341ab7ec7242f6f668c
      https://github.com/wesnoth/wesnoth/commit/304d3dac790759db4ad7a341ab7ec7242f6f668c
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-02 (Wed, 02 Jul 2014)

  Changed paths:
    M src/variable_info.hpp

  Log Message:
  -----------
  add newline at end of file


  Commit: 4ff51a3940bdbf2c9d160a3be4f1978fa0e30d9d
      https://github.com/wesnoth/wesnoth/commit/4ff51a3940bdbf2c9d160a3be4f1978fa0e30d9d
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-03 (Thu, 03 Jul 2014)

  Changed paths:
    M src/tests/test_config.cpp

  Log Message:
  -----------
  add variable_access test case


  Commit: 2a2c16b0565d67c07ffe391e1f37eed4ddfc32e5
      https://github.com/wesnoth/wesnoth/commit/2a2c16b0565d67c07ffe391e1f37eed4ddfc32e5
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-03 (Thu, 03 Jul 2014)

  Changed paths:
    M src/game_events/action_wml.cpp

  Log Message:
  -----------
  make [set_varialbes] mode=replace as default

this was the previous behaviour.
It was broken in variable_info refactor.


  Commit: 6680fa72483770f7f219c1c47f8046818769dfd8
      https://github.com/wesnoth/wesnoth/commit/6680fa72483770f7f219c1c47f8046818769dfd8
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-03 (Thu, 03 Jul 2014)

  Changed paths:
    M src/game_events/action_wml.cpp

  Log Message:
  -----------
  use const variable access for [set_variable] to_variable

we need const access to make '.length' work


  Commit: 441a9a23ff2c45e47f84eba53f902334a93f4da9
      https://github.com/wesnoth/wesnoth/commit/441a9a23ff2c45e47f84eba53f902334a93f4da9
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-04 (Fri, 04 Jul 2014)

  Changed paths:
    M .travis.yml
    M changelog
    R check_utf8.sh
    M data/_main.cfg
    M data/campaigns/Descent_Into_Darkness/scenarios/11_Descent_into_Darkness.cfg
    M data/campaigns/Legend_of_Wesmere/maps/Kalian_map.cfg
    M data/campaigns/Legend_of_Wesmere/scenarios/chapter2/07_Elves_Last_Stand.cfg
    M data/campaigns/Son_Of_The_Black_Eye/utils/utils.cfg
    M data/campaigns/The_Hammer_of_Thursagan/scenarios/11_The_Court_of_Karrag.cfg
    M data/core/about.cfg
    M data/core/editor/help.cfg
    A data/core/images/units/orcs/nightblade-attack-se1.png
    A data/core/images/units/orcs/nightblade-attack-se2.png
    A data/core/images/units/orcs/nightblade-attack-se3.png
    A data/core/images/units/orcs/nightblade-attack-se4.png
    A data/core/images/units/orcs/nightblade-attack-se5.png
    A data/core/images/units/orcs/nightblade-attack-se6.png
    A data/core/images/units/orcs/nightblade-attack-se7.png
    A data/core/images/units/orcs/nightblade-attack-se8.png
    A data/core/images/units/orcs/nightblade-attack-se9.png
    A data/core/images/units/orcs/nightblade-defend-se1-1.png
    A data/core/images/units/orcs/nightblade-defend-se1-2.png
    A data/core/images/units/orcs/nightblade-defend-se1-3.png
    A data/core/images/units/orcs/nightblade-defend-se1-4.png
    A data/core/images/units/orcs/nightblade-defend-se1-5.png
    A data/core/images/units/orcs/nightblade-defend-se2-1.png
    A data/core/images/units/orcs/nightblade-defend-se2-2.png
    A data/core/images/units/orcs/nightblade-kick-se1.png
    A data/core/images/units/orcs/nightblade-kick-se10.png
    A data/core/images/units/orcs/nightblade-kick-se11.png
    A data/core/images/units/orcs/nightblade-kick-se12.png
    A data/core/images/units/orcs/nightblade-kick-se2.png
    A data/core/images/units/orcs/nightblade-kick-se3.png
    A data/core/images/units/orcs/nightblade-kick-se4.png
    A data/core/images/units/orcs/nightblade-kick-se5.png
    A data/core/images/units/orcs/nightblade-kick-se6.png
    A data/core/images/units/orcs/nightblade-kick-se7.png
    A data/core/images/units/orcs/nightblade-kick-se8.png
    A data/core/images/units/orcs/nightblade-kick-se9.png
    A data/core/images/units/orcs/nightblade-se.png
    A data/core/images/units/orcs/nightblade-throw-se1.png
    A data/core/images/units/orcs/nightblade-throw-se2.png
    A data/core/images/units/orcs/nightblade-throw-se3.png
    A data/core/images/units/orcs/nightblade-throw-se4.png
    A data/core/images/units/orcs/nightblade-throw-se5.png
    A data/core/images/units/orcs/nightblade-throw-se6.png
    A data/core/images/units/orcs/nightblade-throw-se7.png
    A data/core/images/units/orcs/nightblade-throw-se8.png
    A data/core/images/units/orcs/nightblade-throw-se9.png
    A data/core/images/units/orcs/nightblade.png
    M data/core/team-colors.cfg
    A data/core/units/orcs/Nightblade.cfg
    M data/cores.cfg
    M data/multiplayer/scenarios/2p_Dark_Forecast.cfg
    M data/multiplayer/scenarios/2p_Hornshark_Island.cfg
    M data/test/_main.cfg
    M data/test/macros/pathfind_answers.cfg
    M data/test/macros/wml_unit_test_macros.cfg
    M data/test/maps/pathfind_1.cfg
    M data/test/scenarios/break_replay_with_lua_random.cfg
    M data/test/scenarios/empty_test.cfg
    M data/test/scenarios/event_handlers_in_events.cfg
    M data/test/scenarios/facing.cfg
    M data/test/scenarios/feeding.cfg
    M data/test/scenarios/move_skip_sighted.cfg
    M data/test/scenarios/order_of_nested_events.cfg
    M data/test/scenarios/prestart_settings.cfg
    M data/test/scenarios/sighted_events.cfg
    M data/test/scenarios/test_assert.cfg
    M data/test/scenarios/test_berzerk_firststrike.cfg
    M data/test/scenarios/test_check_victory.cfg
    M data/test/scenarios/test_grunt_tod_damage.cfg
    M data/test/scenarios/test_move.cfg
    M data/test/scenarios/test_relative_dir.cfg
    M data/test/scenarios/test_unit_map.cfg
    M data/test/scenarios/test_victory_attacks.cfg
    M data/test/scenarios/unit_spawns_at_nearest_vacant_hex.cfg
    M data/test/scenarios/units_offmap_goto_recall.cfg
    M data/themes/classic.cfg
    M data/themes/default.cfg
    M data/themes/editor.cfg
    M data/themes/macros.cfg
    M po/wesnoth-ei/pl.po
    M projectfiles/CodeBlocks/wesnoth.cbp
    M projectfiles/VC9/wesnoth.vcproj
    M projectfiles/Xcode/Wesnoth.xcodeproj/project.pbxproj
    M scons/pango.py
    M src/CMakeLists.txt
    M src/SConscript
    M src/actions/create.cpp
    M src/ai/composite/goal.cpp
    M src/ai/composite/value_translator.hpp
    M src/ai/configuration.cpp
    M src/ai/configuration.hpp
    M src/ai/contexts.cpp
    M src/ai/lua/lua_object.hpp
    M src/ai/recruitment/recruitment.cpp
    M src/ai/testing/aspect_attacks.cpp
    M src/campaign_server/campaign_server.cpp
    M src/display.cpp
    M src/display.hpp
    A src/filter_context.hpp
    M src/game_board.hpp
    M src/game_display.hpp
    M src/game_events/action_wml.cpp
    M src/game_events/conditional_wml.cpp
    M src/game_events/entity_location.cpp
    M src/game_events/menu_item.cpp
    M src/game_events/pump.cpp
    M src/game_state.hpp
    M src/generators/map_create.cpp
    M src/gui/dialogs/debug_clock.cpp
    M src/lua/ldo.cpp
    M src/multiplayer_connect_engine.cpp
    M src/multiplayer_create.cpp
    M src/multiplayer_create_engine.cpp
    M src/pathfind/teleport.cpp
    M src/play_controller.cpp
    M src/play_controller.hpp
    M src/resources.cpp
    M src/resources.hpp
    M src/scripting/lua.cpp
    M src/server/forum_user_handler.cpp
    M src/server/forum_user_handler.hpp
    M src/server/game.cpp
    M src/side_filter.cpp
    M src/side_filter.hpp
    M src/synced_context.cpp
    M src/terrain_builder.cpp
    M src/terrain_filter.cpp
    M src/terrain_filter.hpp
    M src/tests/test_config.cpp
    M src/unit.cpp
    M src/unit.hpp
    M src/unit_abilities.cpp
    M src/unit_animation.cpp
    M src/unit_display.cpp
    A src/unit_filter.cpp
    A src/unit_filter.hpp
    M src/wesnoth.cpp
    R test_wrapper.sh
    R travis_after_failure.sh
    R travis_wml_unit_tests.sh.old
    A utils/travis/check_utf8.sh
    A utils/travis/test_wrapper.sh
    A utils/travis/travis_after_failure.sh.old
    A utils/travis/travis_wml_unit_tests.sh.old
    A utils/travis/wml_unit_tests.old
    R wml_unit_tests.old

  Log Message:
  -----------
  Merge branch 'master' into game_variables

Conflicts:
	src/unit.cpp


  Commit: 9084e5c68c2e11563219e5e9db47448dd71c1180
      https://github.com/wesnoth/wesnoth/commit/9084e5c68c2e11563219e5e9db47448dd71c1180
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-04 (Fri, 04 Jul 2014)

  Changed paths:
    M src/variable_info.cpp

  Log Message:
  -----------
  add index to max_loop check

this check was forgotten during refactoring


  Commit: bc6fa279a4adb9326939b392cd46157d1ae2c078
      https://github.com/wesnoth/wesnoth/commit/bc6fa279a4adb9326939b392cd46157d1ae2c078
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-04 (Fri, 04 Jul 2014)

  Changed paths:
    M src/variable_info.cpp

  Log Message:
  -----------
  don't accept variablenames with index > max_loop

making them default to game_config::max_loop isn't useful im most cases.


  Commit: dc380536b43d6d32bdded58911435b61506a5a2c
      https://github.com/wesnoth/wesnoth/commit/dc380536b43d6d32bdded58911435b61506a5a2c
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-04 (Fri, 04 Jul 2014)

  Changed paths:
    M src/variable_info.cpp
    A stdout.txt

  Log Message:
  -----------
  fix comments in variable_info.cpp


  Commit: c03ac970b071931f5deaa0b961abcb3dffa72dfb
      https://github.com/wesnoth/wesnoth/commit/c03ac970b071931f5deaa0b961abcb3dffa72dfb
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2014-07-05 (Sat, 05 Jul 2014)

  Changed paths:
    M .travis.yml
    M src/pathfind/teleport.cpp
    M src/unit_filter.cpp
    M src/unit_filter.hpp

  Log Message:
  -----------
  Merge branch 'master' into game_variables

Conflicts:
	src/unit_filter.cpp


  Commit: fa28ffba0f1ff91013528d6ea923e98c46f922fc
      https://github.com/wesnoth/wesnoth/commit/fa28ffba0f1ff91013528d6ea923e98c46f922fc
  Author: gfgtdf <tischpapier at gmail.com>
  Date:   2014-07-05 (Sat, 05 Jul 2014)

  Changed paths:
    M src/CMakeLists.txt
    M src/SConscript
    M src/game_data.cpp
    M src/game_data.hpp
    M src/game_events/action_wml.cpp
    M src/menu_events.cpp
    M src/persist_var.cpp
    M src/scripting/lua.cpp
    M src/synced_commands.cpp
    M src/terrain_filter.cpp
    M src/tests/test_config.cpp
    M src/unit.cpp
    M src/unit_filter.cpp
    M src/variable.cpp
    M src/variable.hpp
    A src/variable_info.cpp
    A src/variable_info.hpp
    A src/variable_info_detail.hpp
    A stdout.txt

  Log Message:
  -----------
  Merge pull request #231 from gfgtdf/game_variables

refactor Game variables
we try to resolve dependedcies game_data/game_varibles
we now use c++ const correctness to ensure not to write the game variables if we just want to read them
we improve the performance of wesnoth.set/get_variable, especialy for explicit indexes.
in order to do that we rewrite variable_info class.


Compare: https://github.com/wesnoth/wesnoth/compare/b7927744d78d...fa28ffba0f1f


More information about the Commits mailing list