elluvium / Foxy

Dedicated to our favorite fox
0 stars 0 forks source link

Design classes #9

Open TheCorio opened 7 years ago

TheCorio commented 7 years ago

Needed to be designed:

Eldarionus commented 7 years ago
    public class Goal
    {
        public uint Index { get; set; }
        public string Content { get; set; }
        public string ProvidesFor { get; set; } // TODO edit get() to return int[]
    }

It really doesn't look like OOP style. We better delete property "Index" and do it more like a LinkedList implementation.

public class Goal
{
    private List<Goal> _descendants = new List<Goal>();

    public string Content { get; set; }
    public List<Goal> Descendants => _descendants;
}

And then we'll have class GoalTree

public class GoalTree
{
    public Goal Heap {get; }
}

Or to be more OOP & generics men

public class Goal { string Content {get; set;} ... }
public class GoalTree : Tree<Goal> {...}
public class TreeNode<T> {...} 
public class Tree<T> {...}

btw, I already have my own realization of two last classes.

And for what reason we need GoalTree, GoalHierarchy and GoalGraph classes? From my point of view, they are redundant.

So, I propose my candidature for implementation of this part.

TheCorio commented 7 years ago

Of course you can implement this part. Be my guest!

Here some notes, that might help you: