How can I sync three classes?
Posted
by TheMachineCharmer
on Stack Overflow
See other posts from Stack Overflow
or by TheMachineCharmer
Published on 2010-05-11T07:29:43Z
Indexed on
2010/05/11
7:34 UTC
Read the original article
Hit count: 230
class Foo
{
Bar b;
List<Foo> Neighbours;
}
class Bar
{
Spam s;
List<Bar> Neighbours;
}
class Spam
{
List<string> Neighbours;
}
Each of these classes have AddNeighbour
,RemoveNeighbour
methods.
User can add/remove Neighbours from any of the class at random.
I want these three objects to be in sync.
How can I do this?
© Stack Overflow or respective owner