File: ConditionPythonParser.h

package info (click to toggle)
freeorion 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 194,940 kB
  • sloc: cpp: 186,508; python: 40,969; ansic: 1,164; xml: 719; makefile: 32; sh: 7
file content (35 lines) | stat: -rw-r--r-- 1,357 bytes parent folder | download
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
#ifndef _ConditionPythonParser_h_
#define _ConditionPythonParser_h_

#include <memory>

#include "../universe/Condition.h"

template<typename T>
struct value_ref_wrapper;

namespace boost::python {
    class dict;
}

struct condition_wrapper {
    condition_wrapper(std::shared_ptr<Condition::Condition>&& ref) : condition(std::move(ref)) {}
    condition_wrapper(const std::shared_ptr<Condition::Condition>& ref) : condition(ref) {}

    const std::shared_ptr<const Condition::Condition> condition;
};

condition_wrapper operator&(const condition_wrapper&, const condition_wrapper&);
condition_wrapper operator&(const condition_wrapper&, const value_ref_wrapper<double>&);
condition_wrapper operator&(const condition_wrapper&, const value_ref_wrapper<int>&);
condition_wrapper operator&(const value_ref_wrapper<double>&, const value_ref_wrapper<double>&);
condition_wrapper operator&(const value_ref_wrapper<int>&, const condition_wrapper&);
condition_wrapper operator|(const condition_wrapper&, const condition_wrapper&);
condition_wrapper operator|(const value_ref_wrapper<int>&, const value_ref_wrapper<int>&);
condition_wrapper operator|(const condition_wrapper&, const value_ref_wrapper<int>&);
condition_wrapper operator~(const condition_wrapper&);

void RegisterGlobalsConditions(boost::python::dict& globals);

#endif // _ConditionPythonParser_h_