forked from cataclysmbnteam/Cataclysm-BN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
behavior_strategy.h
48 lines (37 loc) · 1.18 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
48
#pragma once
#ifndef CATA_SRC_BEHAVIOR_STRATEGY_H
#define CATA_SRC_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 ~strategy_t() = default;
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 // CATA_SRC_BEHAVIOR_STRATEGY_H