-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSketch.cpp
33 lines (27 loc) · 903 Bytes
/
Sketch.cpp
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
#include "Sketch.h"
using namespace std;
Sketch::Sketch(string name, bool shouldGenerate) {
projectName = name;
generateMode = shouldGenerate;
strokeColor = -1;
threeFunc["circle"] = ofDrawCircle;
fourFunc["rect"] = ofDrawRectangle;
fourFunc["ellipse"] = ofDrawEllipse;
fourFunc["line"] = ofDrawLine;
};
void Sketch::drawFour(string funcName, string a, string b, string c, string d) {
int x = stoi(a), y = stoi(b), w = stoi(c), h = stoi(d);
fourFunc[funcName](x, y, w, h);
}
void Sketch::drawThree(string funcName, string a, string b, string c) {
int x = stoi(a), y = stoi(b), r = stoi(c);
threeFunc[funcName](x, y, r);
}
void Sketch::drawOne(string funcName, string a) {
if (funcName == "fill") {
ofSetHexColor(stoi(a, 0, 16));
ofFill();
} else if (funcName == "stroke") {
int strokeColor = stoi(a, 0, 16);
}
}