T
Trey
Is it possible to access the parent from an instance of a "child"
class? For example in the code below I would like to be able to
reference which exact army a troop belonged to by doing something like
myTroop.Parent().
If not, is there a home grown solution I can implement short of
creating an army "id" and dealing with key management between troop <->
army? I'm basically looking for cheap relationship management.
Thanks,
Trey
internal class Army
{
int myMember;
internal Troop[] Troops = new Troop[100];
Army()
{
}
internal class Troop
{
Troop()
{
}
}
}
class? For example in the code below I would like to be able to
reference which exact army a troop belonged to by doing something like
myTroop.Parent().
If not, is there a home grown solution I can implement short of
creating an army "id" and dealing with key management between troop <->
army? I'm basically looking for cheap relationship management.
Thanks,
Trey
internal class Army
{
int myMember;
internal Troop[] Troops = new Troop[100];
Army()
{
}
internal class Troop
{
Troop()
{
}
}
}