One small step in algorithms

So, from my last update, I got most of it working. Using 3 interfaces, I have the CEO of a company being created, and all the idle employees being placed into the idle panel, along with an empty slot being spawned in order to start getting people managed and working.


Which is all fine and good. I’m pretty happy with how the concept worked out. I had trouble working with interfaces for the first time, because I didn’t realize what properties were. When I tried to put a field into an interface, it would kick it back. So I thought I couldn’t have guaranteed fields for interfaces. I tried to make get methods, but as I began to work on the display level of the code, it was causing all kinds of problems. I finally looked it up online if I could guarantee fields, and discovered properties and get/setters. I don’t really understand what the difference between a field and a property is, as in why you would have fields at all if there are properties in the language, but here we are.

As soon as I put properties into my interfaces, the display code just fell out easily.

So, now I’m at a crossroads. How does the tree know where to place all these card holders onto the board? Clearly we can’t have them stacked on top of each other. How does it detect to place an empty? Where does it place it? What if I pull a card out of a slot…does it disappear? Do the other slots need to be reordered? I want to add managers to managers, increasing the tree. Where does it place these cards? Do we start at the bottom or the top?

This is going to require math, unfortunately. I’m going to have to develop some algorithms on detecting which tier of the tree we are at, how many items are in the tree at that tier level, and so forth.

So for now, at a wall. Time to research and figure out how it needs to be displayed.

Share this post:

Be the first to comment

Leave a Reply

Your email address will not be published.