Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Room_List
- {
- node Node;
- public:
- Room_List()
- {
- Node.Current=NULL;
- Node.Next=NULL;
- };
- void Add_to_Room_List( Room* room)
- {
- node *n=&(this->Node);
- while(n->Next!=NULL)
- n=n->Next;
- if(n->Current!=NULL)
- {
- node *tmp=(node*)malloc(sizeof(node));
- tmp->Next=NULL;
- tmp->Current=room;
- n->Next=tmp;
- }
- else
- {
- n->Current=room;
- n->Next=NULL;
- }
- };
- ~Room_List()
- {
- node *N=&(this->Node);
- node *tmp=N;
- while(N->Next!=NULL)
- {
- N=N->Next;
- cout<<"tmp";//поиск места ошибки
- free(tmp);
- tmp=N;
- }
- cout<<"N error";//поиск места ошибки
- free(N);
- };
- };
- //Room-другой класс
- class Room
- {
- friend class Room_List;
- protected:
- COORD OO;
- COORD XY;
- COORD_Matrix Doors;
- Character_Matrix Enemies;//здесь только поля без методов
- //...
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement