-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLsystem.h
42 lines (36 loc) · 1.08 KB
/
Lsystem.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
#ifndef LSYSTEM_H
#define LSYSTEM_H
#include "Context.h"
#include "DrawStrategy.hpp"
#include "Rule.h"
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
class Lexer;
class Lsystem {
public:
Lsystem(std::string_view name, Lexer &lex);
const std::string& getname() const;
bool isactive() const;
const Exprtype & getExpressions() const;
const Ruletable & getRules() const;
const std::string & startRule() const;
DrawStrategyToken getDrawStrategyToken() const;
void fixRules(const Context &context);
void evaluateExpressions(const Context &context);
void draw(int level, DrawStrategy & drawStrategy) const;
void draw(int level, DrawStrategy & drawStrategy, std::string_view name) const;
private:
void readSystemOptions(Lexer &lex);
std::string _name;
std::string _info;
bool active=true;
Ruletable _rules;
std::string startrule;
Exprtype expressions;
DrawStrategyToken _drawStrategyToken;
};
std::vector<Lsystem> readlsystemfile(const std::string &configfilename =
"config file.txt");
#endif