forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbehavior_strategy.h
47 lines (36 loc) · 1.09 KB
/
behavior_strategy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#ifndef BEHAVIOR_STRATEGY_H
#define BEHAVIOR_STRATEGY_H
#include <unordered_map>
#include <vector>
#include <string>
namespace behavior
{
class node_t;
class oracle_t;
enum status_t : char;
struct behavior_return;
class strategy_t
{
public:
virtual behavior_return evaluate( const oracle_t *subject,
std::vector<const node_t *> children ) const = 0;
};
class sequential_t : public strategy_t
{
behavior_return evaluate( const oracle_t *subject,
std::vector<const node_t *> children ) const override;
};
class fallback_t : public strategy_t
{
behavior_return evaluate( const oracle_t *subject,
std::vector<const node_t *> children ) const override;
};
class sequential_until_done_t : public strategy_t
{
behavior_return evaluate( const oracle_t *subject,
std::vector<const node_t *> children ) const override;
};
extern std::unordered_map<std::string, const strategy_t *> strategy_map;
} // namespace behavior
#endif