This removes the C++ common interface intended for creating new AIs.
Anyone wishing to create a new AI written in C++ should now implement it as a custom stage instead.
This commit also removes the C++ implementation of the Idle AI (but leaves the WML definition of it, which is based on the composite AI)
and the fallback stage which was intended to fall back to other C++ AI algorithms.
And related commits.
This reverts commit 545253ec2b.
This reverts commit 1215f65eb8.
This reverts commit 11664f4024.
This reverts commit e948df3424.
This reverts commit 3781e7839f.
This commits were reverted to exclude them from wesnoth 1.13.2 release because:
1) We are still unsure about the best name oftthese attributes
2) This breaks multiple campaigns, including LoW and the tutorial.
Feel free to revert this revert after 1.13.2 when thse issues can be solved..
- The "category" property is mainly for use by scenario designers; players will be able to hide labels based on this
- The "creator" property is meant to allow players to hide labels placed by specific other players
- Map editor allows setting the "category" property
Previously recorder had config memaber and saved_game had a config
memeber.
And when saving a game the config was copied from recorder to saved_game
and the other way when loading a game.
Now the recorder object directly writes into the saved_game object. This
saves some copying when saving and loading data.
I also moved the pos_ variable from the recorder object to the
saved_game replay_recorder_base object, This fixes a bug where saving a
game during a replay also caused to not yet played turns to be written
into the savefile.
This is a chearry pick by me (gfgtdf) of 66176b1738. It differes a lot from the original becasue since there were so much merging conflics i decided to do it mostly from scratch.
Conflicts:
src/addon/manager.cpp
src/addon/manager_ui.cpp
src/campaign_server/campaign_server.cpp
src/config_cache.cpp
src/create_engine.cpp
src/editor/map/context_manager.cpp
src/editor/map/map_context.cpp
src/font.cpp
src/game_config_manager.cpp
src/gamestatus.cpp
src/gui/dialogs/editor/custom_tod.cpp
src/gui/dialogs/lobby/lobby_data.cpp
src/gui/dialogs/mp_create_game.cpp
src/gui/widgets/settings.cpp
src/hotkeys.cpp
src/image.cpp
src/multiplayer_lobby.cpp
src/network.cpp
src/playcampaign.cpp
src/preferences.cpp
src/savegame.cpp
src/serialization/preprocessor.cpp
src/tests/main.cpp
src/wesnoth.cpp
src/widgets/button.cpp
This the result of executing, in folder src/, the following
find . -type f -exec sed -i 's/\*resources\:\:game_map/resources\:\:gameboard->map()/g' '{}' \;
and carefully inspecting the result.
We also had to add game_board.hpp includes in various places,
and change the arguent order of unit::is_visible_to_team --
this function was taking *resources::game_map as its default
argument, and we do not want to include game_board in unit.hpp,
as it creates cyclic dependencies. This was resolved by
eliminating this as a default value -- this is an improvement,
since usually when this function was called it was in a context
where a game_map was available already locally anyways.
This is the result of running, in src/ directory, the following:
find . -type f -exec sed -i 's/resources::game_map->/resources::gameboard->map()./g' '{}' \;
and carefully inspecting the result, and adding "game_board.hpp"
Just wanted to remove the empty strings that got created:
find . -type f -exec sed -i 's/<< "" <</<</g' '{}' \;
find . -type f -exec sed -i 's/<<"" <</<</g' '{}' \;
I also unstaged tools/schema/tags.cpp, since I don't think I changed
that.
This is the result of running command, in src/,
find . -type f -exec sed -i 's/\(WRN.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;
and inspecting the results.
Also ran this subsequently:
find . -type f -exec sed -i 's/\(WARN.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;
which only affected render.cpp
This is the result of running this command in directory src/
find . -type f -exec sed -i 's/\(ERR.*\)\\n\"\;/\1\" << std::endl\;/g' '{}' \;
and carefully inspecting the results.
If we decided it was worth it to inline map_location ==, then
surely this is also worth it to inline null_location, as the
compiler may be able to reduce tests for == null location to
"x == ... && y == ...", without having to move to a different
compilation unit.
This is a general overhaul of the class embodying movement types,
featuring:
* Better data encapsulation
* Less duplication of code between unit.cpp and unit_type.cpp
* Easier to use
* New files for the class (VC and XCode projects still need updating)
* New (shorter) name for the class
Some additional revisions will be coming.
The primary motivation for this was to get a class that embodies
movement costs (part of the data encapsulation).
Modified pathfind::paths to take a unit as argument instead of its
location; updated all callers.
As observed by mattsc, the function did in its callstack
re-query the unit at the location of a passed private proxy unit,
calculating the reach for the unit in the unit_map at that
location instead of the private one.
The other pathfind bindings already work for private proxy
units. Private lua proxy units were introduced after the pathfinder
functions were already exposed in the lua API.
The calculate_map_ownership_function function didn't test the
boundaries. There might still be a bug lurking in the WML; fendrin
please have a look. Fixes the issue reported in [1].
[1] http://forums.wesnoth.org/viewtopic.php?f=4&t=34006