Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Plansza::fillArray(fstream& inFile)
- {
- string line;
- while(getline(inFile, line))
- {
- line.erase(remove(line.begin(), line.end(), ' '), line.end());
- cout<<line<<endl;
- for(int j=0;j<getLines();j++)
- {
- for (int i = 0; i<getColumns(); i++)
- {
- if (line[i] == '0')
- {
- tab[j][i]=new Martwa;
- cout<<tab[j][i]->stan<<endl;
- }
- else if (line[i] == '1')
- {
- tab[j][i] =new Zywa;
- cout<<tab[j][i]->stan<<endl;
- }
- else if (line[i] == 'H')
- {
- tab[j][i] = new Hibernacja;
- cout<<tab[j][i]->stan<<endl;
- }
- else if (line[i] == 'O')
- {
- tab[j][i] =new Otoczona;
- cout<<tab[j][i]->stan<<endl;
- }
- else if (line[i] == 'T')
- {
- tab[j][i] =new Trudna;
- cout<<tab[j][i]->stan<<endl;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement