mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 21:55:42 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
804bb0b059 | ||
|
|
833c6a5cf6 |
@@ -97,7 +97,7 @@ void ShardokEngine::ApplyAndAddActionResults(const vector<ActionResultProto> &re
|
||||
}
|
||||
|
||||
void ShardokEngine::ApplyAndAddActionResult(const ActionResultProto &result) {
|
||||
MutatingApplyResult(gameState, result, settingsGetter);
|
||||
gameState = ApplyResult(std::move(gameState), result, settingsGetter);
|
||||
|
||||
if (trackHistory) {
|
||||
actionHistory.emplace_back();
|
||||
|
||||
+3
-5
@@ -168,13 +168,11 @@ void MutatingAddUnits(GameStateW &mutatingState, const ActionResultProto &result
|
||||
}
|
||||
|
||||
auto ApplyResult(
|
||||
const GameStateW &startingState,
|
||||
GameStateW startingState,
|
||||
const ActionResultProto &result,
|
||||
const SettingsGetter &settings) -> GameStateW {
|
||||
auto endGS = startingState;
|
||||
MutatingApplyResult(endGS, result, settings);
|
||||
|
||||
return endGS;
|
||||
MutatingApplyResult(startingState, result, settings);
|
||||
return startingState;
|
||||
}
|
||||
|
||||
void MutatingApplyResult(
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ void MutatingApplyResult(
|
||||
const ActionResultProto& actionResult,
|
||||
const SettingsGetter& settings);
|
||||
auto ApplyResult(
|
||||
const GameStateW& startingState,
|
||||
GameStateW startingState,
|
||||
const ActionResultProto& actionResult,
|
||||
const SettingsGetter& settings) -> GameStateW;
|
||||
auto ApplyResults(
|
||||
|
||||
@@ -425,6 +425,7 @@ cc_library(
|
||||
deps = [
|
||||
"//src/main/cpp/net/eagle0/shardok/library:battalion_type",
|
||||
"//src/main/cpp/net/eagle0/shardok/library:shardok_command",
|
||||
"//src/main/cpp/net/eagle0/shardok/library/action_result_applier",
|
||||
"//src/main/cpp/net/eagle0/shardok/library/actions:defensive_ambush_action",
|
||||
"//src/main/cpp/net/eagle0/shardok/library/settings:game_settings",
|
||||
"//src/main/cpp/net/eagle0/shardok/library/unit",
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "src/main/cpp/net/eagle0/shardok/library/action_result_applier/ActionResultApplier.hpp"
|
||||
#include "src/main/cpp/net/eagle0/shardok/library/actions/DefensiveAmbushAction.hpp"
|
||||
#include "src/main/cpp/net/eagle0/shardok/library/unit/Unit.hpp"
|
||||
#include "src/main/cpp/net/eagle0/shardok/library/util/ActionResultFlatbufferHelpers.hpp"
|
||||
|
||||
Reference in New Issue
Block a user