|
-
Jun 8th, 2001, 08:28 AM
#1
Thread Starter
New Member
Classes
Does anyone know how to get an object to know itself?
I mean, like in VB you can use 'Me'
Eg.
class Room
{
Room* Exit[4];
void Make_Exit(Room* New_Room, int Direction)
{
int Noitcerid = (Direction + 2) % 4; //Opposite direction
Exit[Direction] = New_Room;
New_Room->Exit[Noitcerid] = Me;
}
}
Room Lounge, Kitchen;
void Init(void)
{
Lounge.Make_Exit(Kitchen,0);
}
And this would make an exit from Lounge to Kitchen and from Kitchen to Lounge, if 'Me' worked!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|