Vajad kellegagi rääkida?
Küsi julgelt abi LasteAbi
Logi sisse
Sulge

"addroom" - 1 õppematerjal

Labyrinth 2-kodutöö
12
docx

Labyrinth 2. kodutöö

" << endl; cin.ignore(100,'n'); return EXIT_SUCCESS; } #include #include "Room.h" #include "Player.h" #include "Maze.h" using namespace std; Maze::Maze(string n) { name = n; entry = new Room("ENTRY",this); // cout << this << endl; entry->setMaze(this); rooms.push_back(entry); } Room* Maze::getEntry() { return entry; } string Maze::getName() { return name; } void Maze::print(string text) { cout << "Prindin Maze-i..." << endl; } void Maze::addRoom(Room* newRoom) { rooms.push_back(newRoom); } bool Maze::removeRoom(Room* room) { for (int i=0; i < rooms.size(); i++) { if (rooms[i] == room) { rooms.erase(rooms.begin() + i); return true; } } return false; } #ifndef MAZE_H #define MAZE_H #include "Player.h" #include "Room.h" #include #include using namespace std; class Maze { string name; Room* entry; vector rooms; public: Maze(string name);

Informaatika → Keel c ja objektorienteeritud...
26 allalaadimist


Sellel veebilehel kasutatakse küpsiseid. Kasutamist jätkates nõustute küpsiste ja veebilehe üldtingimustega Nõustun