-
Notifications
You must be signed in to change notification settings - Fork 0
/
levelzero.cc
33 lines (30 loc) · 964 Bytes
/
levelzero.cc
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 "levelzero.h"
#include <iostream>
using namespace std;
LevelZero::LevelZero(vector <vector <Cell>> * bd, string path):
Difficulty{bd, path}
{
loadPath = path;
std::ifstream reader(loadPath);
char c = '0';
while(reader >> c){
Shape s = Shape::Iblock;
switch(c){
case Content::I : s = Shape::Iblock; break;
case Content::J : s = Shape::Jblock; break;
case Content::O : s = Shape::Oblock; break;
case Content::L : s = Shape::Lblock; break;
case Content::S : s = Shape::Sblock; break;
case Content::Z : s = Shape::Zblock; break;
case Content::T : s = Shape::Tblock; break;
} generationSequence.emplace_back(s);
}
}
LevelZero::LevelZero(){}
Block LevelZero::newBlock(){
if(generationSequence.size() != 0){
counter %= generationSequence.size();
return Block(generationSequence[counter++], 0, 3, 0, Level::lvl0);
} else return Block();
}
void LevelZero::setLoadPath(std::string){}