M
M
M3fist02015-07-28 00:23:36
Algorithms
M3fist0, 2015-07-28 00:23:36

Genealogical tree in C#?

Hello!
There is an idea to write software for building, displaying and printing a family tree.
I am learning C# and would like to implement all this on it. Using WPF, of course :)
Everything is fine, but I still don't know where to start. That is, I have an idea that each object should contain something like List parents and List children, and so on. But I don’t know how, let’s say, “canonical” to implement this.
I am currently studying the sources of the program Family.Show. But I would still like advice on how to start implementing such a program.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oxoron, 2015-07-28
@Oxoron

You make the class Person{string Name, string FirstSurname, string SecondSurname, List parents, List wifes\husbunds, List children}.
Name, surname before the wedding, surname after (by the way, there can be many weddings, you can make a list of surnames), a list of parents (children can live in an orphanage, with foster children, with homosexuals, or they can be conceived by midi-chlorians), a list of wives / husbands, a list children. All.
When adding child B to person A, you check whether B has person A in the list of parents. If not, you add. When adding person A to wife B, you check if B has person A in the list of husbands / wives. If not, you add. Etc. for each connection (both ways).

V
V Sh., 2015-08-03
@JuniorNoobie

Create a class containing a name, a pointer to mom, and a pointer to dad. I think this is enough to build a family tree. Such a thing is very well implemented in LISP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question