class pointing variable in c sharp(C#)?

kty1104

New member
hi there,
I am a C# beginner.
I need a class pointing variable
but I have no idea what I have to do.
the situation is looks like this.
there is map class
map class makes tile instances(100*100) when initialized
there are several map instances map0, map1, map2 and so on
I want to access to tile instance through map instance
from character instance's teleport method
teleport method looks like below
teleport(int x, int y, map towhere)
{this.m = towhere;
if(towhere.tile[x,y].passage == false)
MessageBox.Show("can't go there");
else{
this.x=x;
this.y=y;
}

}
character class have teleport method and m variable that referring where the character is in.

thus when I want to move character to map1 from map0, and coordinate is 0,0
then, I want to use like this
hero1.move(0,0,map1);

could somebody please help or advice me?
your little advice would be very helpful for me.
it's ok advice is not a solution but just hint or suggestion of other way.
Thanks in advanced.
 
Back
Top