Skip to content

Commit 5a0d085

Browse files
committed
xrAICore, xrGame: fix windows build
1 parent 1b8ecad commit 5a0d085

13 files changed

+40
-36
lines changed

src/xrAICore/Components/operator_abstract.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
template <typename _world_property, typename _edge_value_type>
1414
class COperatorAbstract
1515
{
16+
public:
17+
typedef _edge_value_type edge_value_type;
18+
1619
protected:
1720
typedef CConditionState<_world_property> inherited;
1821
typedef inherited CSConditionState;
@@ -38,8 +41,8 @@ class COperatorAbstract
3841
IC const CSConditionState& effects() const;
3942
IC void add_condition(const COperatorCondition& condition);
4043
IC void add_effect(const COperatorCondition& effect);
41-
IC void remove_condition(const typename COperatorCondition::_condition_type& condition);
42-
IC void remove_effect(const typename COperatorCondition::_condition_type& effect);
44+
IC void remove_condition(const typename COperatorCondition::condition_type& condition);
45+
IC void remove_effect(const typename COperatorCondition::condition_type& effect);
4346
IC _edge_value_type min_weight() const;
4447

4548
template <typename T>

src/xrAICore/Components/operator_abstract_inline.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ IC void CAbstractOperator::add_condition(const COperatorCondition& condition)
6565
}
6666

6767
TEMPLATE_SPECIALIZATION
68-
IC void CAbstractOperator::remove_condition(const typename COperatorCondition::_condition_type& condition)
68+
IC void CAbstractOperator::remove_condition(const typename COperatorCondition::condition_type& condition)
6969
{
7070
actual(false);
7171
m_conditions.remove_condition(condition);
@@ -79,7 +79,7 @@ IC void CAbstractOperator::add_effect(const COperatorCondition& effect)
7979
}
8080

8181
TEMPLATE_SPECIALIZATION
82-
IC void CAbstractOperator::remove_effect(const typename COperatorCondition::_condition_type& effect)
82+
IC void CAbstractOperator::remove_effect(const typename COperatorCondition::condition_type& effect)
8383
{
8484
actual(false);
8585
m_effects.remove_condition(effect);

src/xrAICore/Components/problem_solver.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ class CProblemSolver
3737
typedef _operator_ptr _operator_ptr;
3838
typedef _condition_evaluator_ptr _condition_evaluator_ptr;
3939
#endif
40-
typedef typename _operator_condition::_condition_type _condition_type;
41-
typedef typename _operator_condition::_value_type value_type;
42-
typedef typename _operator::_edge_value_type edge_value_type;
40+
typedef typename _operator_condition::condition_type condition_type;
41+
typedef typename _operator_condition::value_type value_type;
42+
typedef typename _operator::edge_value_type edge_value_type;
4343
typedef CState _index_type;
44+
typedef _operator_id_type edge_type;
4445

4546
struct SOperator
4647
{
@@ -57,7 +58,7 @@ class CProblemSolver
5758
};
5859
typedef xr_vector<SOperator> OPERATOR_VECTOR;
5960
typedef typename OPERATOR_VECTOR::const_iterator const_iterator;
60-
typedef AssociativeVector<_condition_type, _condition_evaluator_ptr> EVALUATORS;
61+
typedef AssociativeVector<condition_type, _condition_evaluator_ptr> EVALUATORS;
6162

6263
protected:
6364
OPERATOR_VECTOR m_operators;
@@ -93,13 +94,13 @@ class CProblemSolver
9394
struct helper
9495
{
9596
template <bool a>
96-
static IC edge_value_type estimate_edge_weight_impl(std::enable_if_t<a, self_type const&> self, const _index_type& vertex_index)
97+
static IC edge_value_type estimate_edge_weight_impl(std::enable_if_t<!a, self_type const&> self, const _index_type& vertex_index)
9798
{
9899
return self.estimate_edge_weight_impl(vertex_index);
99100
}
100101

101102
template <bool a>
102-
static IC edge_value_type estimate_edge_weight_impl(std::enable_if_t<!a, self_type const&> self, const _index_type& vertex_index)
103+
static IC edge_value_type estimate_edge_weight_impl(std::enable_if_t<a, self_type const&> self, const _index_type& vertex_index)
103104
{
104105
return self.estimate_edge_weight_impl(vertex_index, true);
105106
}
@@ -139,12 +140,12 @@ class CProblemSolver
139140
IC const CState& target_state() const;
140141

141142
// evaluator interface
142-
IC virtual void add_evaluator(const _condition_type& condition_id, _condition_evaluator_ptr evaluator);
143-
IC virtual void remove_evaluator(const _condition_type& condition_id);
144-
IC _condition_evaluator_ptr evaluator(const _condition_type& condition_id) const;
143+
IC virtual void add_evaluator(const condition_type& condition_id, _condition_evaluator_ptr evaluator);
144+
IC virtual void remove_evaluator(const condition_type& condition_id);
145+
IC _condition_evaluator_ptr evaluator(const condition_type& condition_id) const;
145146
IC const EVALUATORS& evaluators() const;
146147
IC void evaluate_condition(typename xr_vector<_operator_condition>::const_iterator& I,
147-
typename xr_vector<_operator_condition>::const_iterator& E, const _condition_type& condition_id) const;
148+
typename xr_vector<_operator_condition>::const_iterator& E, const condition_type& condition_id) const;
148149

149150
// solver interface
150151
IC void solve();

src/xrAICore/Components/problem_solver_inline.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,14 @@ IC const typename CProblemSolverAbstract::CState& CProblemSolverAbstract::target
143143
}
144144

145145
TEMPLATE_SPECIALIZATION
146-
IC void CProblemSolverAbstract::add_evaluator(const _condition_type& condition_id, _condition_evaluator_ptr evaluator)
146+
IC void CProblemSolverAbstract::add_evaluator(const condition_type& condition_id, _condition_evaluator_ptr evaluator)
147147
{
148148
THROW(evaluators().end() == evaluators().find(condition_id));
149149
m_evaluators.insert(std::make_pair(condition_id, evaluator));
150150
}
151151

152152
TEMPLATE_SPECIALIZATION
153-
IC void CProblemSolverAbstract::remove_evaluator(const _condition_type& condition_id)
153+
IC void CProblemSolverAbstract::remove_evaluator(const condition_type& condition_id)
154154
{
155155
typename EVALUATORS::iterator I = m_evaluators.find(condition_id);
156156
THROW(I != m_evaluators.end());
@@ -168,7 +168,7 @@ IC void CProblemSolverAbstract::remove_evaluator(const _condition_type& conditio
168168

169169
TEMPLATE_SPECIALIZATION
170170
IC _condition_evaluator_ptr CProblemSolverAbstract::evaluator(
171-
const _condition_type& condition_id) const
171+
const condition_type& condition_id) const
172172
{
173173
typename EVALUATORS::const_iterator I = evaluators().find(condition_id);
174174
THROW(evaluators().end() != I);
@@ -183,7 +183,7 @@ IC const typename CProblemSolverAbstract::EVALUATORS& CProblemSolverAbstract::ev
183183

184184
TEMPLATE_SPECIALIZATION
185185
IC void CProblemSolverAbstract::evaluate_condition(typename xr_vector<_operator_condition>::const_iterator& I,
186-
typename xr_vector<_operator_condition>::const_iterator& E, const _condition_type& condition_id) const
186+
typename xr_vector<_operator_condition>::const_iterator& E, const condition_type& condition_id) const
187187
{
188188
size_t index = I - m_current_state.conditions().begin();
189189
m_current_state.add_condition(I, _operator_condition(condition_id, evaluator(condition_id)->evaluate()));

src/xrAICore/Navigation/PathManagers/path_manager_solver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CPathManager<CProblemSolver<T1, T2, T3, T4, T5, T6, T7, T8>, _DataStorage,
2323

2424
protected:
2525
typedef CProblemSolver<T1, T2, T3, T4, T5, T6, T7, T8> _Graph;
26-
typedef typename _Graph::_edge_type _edge_type;
26+
typedef typename _Graph::edge_type _edge_type;
2727
xr_vector<_edge_type>* m_edge_path;
2828
const_iterator m_iterator;
2929

src/xrAICore/Navigation/graph_edge.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CEdge : public CEdgeBase<_edge_weight_type, _vertex_type>
3737
_edge_data_type m_data;
3838

3939
public:
40-
using _vertex_id_type = typename inherited::_vertex_id_type;
40+
using _vertex_id_type = typename inherited::vertex_id_type;
4141

4242
IC CEdge(const _edge_weight_type& weight, _vertex_type* vertex);
4343
IC bool operator==(const typename _vertex_type::vertex_id_type& vertex_id) const;

src/xrGame/action_base.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class CActionBase : public GraphEngineSpace::CWorldOperator
4444
u32 m_start_level_time;
4545
u32 m_start_game_time;
4646
u32 m_inertia_time;
47-
mutable _edge_value_type m_weight;
47+
mutable edge_value_type m_weight;
4848
bool m_first_time;
4949

5050
#ifdef LOG_ACTION
@@ -69,14 +69,14 @@ class CActionBase : public GraphEngineSpace::CWorldOperator
6969
virtual void initialize();
7070
virtual void execute();
7171
virtual void finalize();
72-
virtual _edge_value_type weight(const CSConditionState& condition0, const CSConditionState& condition1) const;
72+
virtual edge_value_type weight(const CSConditionState& condition0, const CSConditionState& condition1) const;
7373
IC void set_inertia_time(u32 inertia_time);
7474
IC u32 start_level_time() const;
7575
IC u32 inertia_time() const;
7676
IC bool completed() const;
7777
IC void set_property(const _condition_type& condition_id, const _value_type& value);
7878
IC const _value_type& property(const _condition_type& condition_id) const;
79-
IC void set_weight(const _edge_value_type& weight);
79+
IC void set_weight(const edge_value_type& weight);
8080
IC bool first_time() const;
8181

8282
virtual void save(NET_Packet& packet) {}

src/xrGame/action_base_inline.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void CBaseAction::init(_object_type* object, LPCSTR action_name)
3131
{
3232
m_storage = 0;
3333
m_object = object;
34-
m_weight = _edge_value_type(1);
34+
m_weight = edge_value_type(1);
3535

3636
#ifdef LOG_ACTION
3737
m_use_log = false;
@@ -153,12 +153,12 @@ IC const typename CBaseAction::_value_type& CBaseAction::property(const _conditi
153153
}
154154

155155
TEMPLATE_SPECIALIZATION
156-
IC void CBaseAction::set_weight(const _edge_value_type& weight) { m_weight = _max(min_weight(), weight); }
156+
IC void CBaseAction::set_weight(const edge_value_type& weight) { m_weight = _max(min_weight(), weight); }
157157
TEMPLATE_SPECIALIZATION
158-
typename CBaseAction::_edge_value_type CBaseAction::weight(
158+
typename CBaseAction::edge_value_type CBaseAction::weight(
159159
const CSConditionState& condition0, const CSConditionState& condition1) const
160160
{
161-
_edge_value_type _min_weight = min_weight();
161+
edge_value_type _min_weight = min_weight();
162162
if (m_weight < _min_weight)
163163
m_weight = _min_weight;
164164
return (m_weight);

src/xrGame/action_base_script.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ IC static void CScriptActionBase_Export(lua_State* luaState)
2828
.def("add_effect", (void (CScriptActionBase::*)(const CScriptActionBase::COperatorCondition&))(
2929
&CScriptActionBase::add_effect))
3030
.def("remove_precondition",
31-
(void (CScriptActionBase::*)(const CScriptActionBase::COperatorCondition::_condition_type&))(
31+
(void (CScriptActionBase::*)(const CScriptActionBase::COperatorCondition::condition_type&))(
3232
&CScriptActionBase::remove_condition))
3333
.def("remove_effect",
34-
(void (CScriptActionBase::*)(const CScriptActionBase::COperatorCondition::_condition_type&))(
34+
(void (CScriptActionBase::*)(const CScriptActionBase::COperatorCondition::condition_type&))(
3535
&CScriptActionBase::remove_effect))
3636
.def("setup", &CScriptActionBase::setup, &CScriptActionWrapper::setup_static)
3737
.def("initialize", &CScriptActionBase::initialize, &CScriptActionWrapper::initialize_static)

src/xrGame/action_planner.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ class CActionPlanner
3131
CProblemSolver;
3232
using COperator = typename CProblemSolver::COperator;
3333
using CConditionEvaluator = typename CProblemSolver::CConditionEvaluator;
34-
using _condition_type = typename CProblemSolver::_condition_type;
35-
using _edge_type = typename CProblemSolver::_edge_type;
36-
using _value_type = typename CProblemSolver::_value_type;
34+
using _condition_type = typename CProblemSolver::condition_type;
35+
using _edge_type = typename CProblemSolver::edge_type;
36+
using _value_type = typename CProblemSolver::value_type;
3737
using _operator_ptr = typename CProblemSolver::_operator_ptr;
3838
typedef CProblemSolver inherited;
39-
typedef typename inherited::_edge_type _action_id_type;
39+
typedef typename inherited::edge_type _action_id_type;
4040
typedef GraphEngineSpace::CWorldProperty CWorldProperty;
4141
typedef GraphEngineSpace::CWorldState CWorldState;
4242
typedef _world_operator _world_operator;

src/xrGame/action_planner_action.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class CActionPlannerAction : public CActionPlanner<_object_type>, public CAction
1919
protected:
2020
using inherited_planner = CActionPlanner<_object_type>;
2121
using inherited_action = CActionBase<_object_type>;
22-
using _edge_value_type = typename inherited_action::_edge_value_type;
22+
using _edge_value_type = typename inherited_action::edge_value_type;
2323
using _condition_type = typename inherited_action::_condition_type;
2424
using _value_type = typename inherited_action::_value_type;
2525

src/xrGame/stalker_combat_actions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static const u32 s_wait_enemy_in_smart_cover_time = 30 * 1000;
5858
using namespace StalkerSpace;
5959
using namespace StalkerDecisionSpace;
6060

61-
typedef CStalkerActionBase::_edge_value_type _edge_value_type;
61+
typedef CStalkerActionBase::edge_value_type _edge_value_type;
6262

6363
#ifdef _DEBUG
6464
//# define SILENT_COMBAT

src/xrGame/stalker_combat_actions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CStalkerActionRetreatFromEnemy : public CStalkerActionCombatBase
6565
virtual void initialize();
6666
virtual void execute();
6767
virtual void finalize();
68-
virtual _edge_value_type weight(const CSConditionState& condition0, const CSConditionState& condition1) const;
68+
virtual edge_value_type weight(const CSConditionState& condition0, const CSConditionState& condition1) const;
6969
};
7070

7171
//////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)