August 2003 - Posts
I was under the assumption GDI+, the high level api in .NET for drawing “stuff” would fit my needs:
- visualize objects
- selecting objects
- drag / drop objects
- object collision detection
- simple but smart placement algorithm
I started googling for some reference code. No results, even gotdotnet seems to lack a solid example. So I started to prototype a simple 2D “engine“…
Controller
Canvas
DrawableObject
Engine
// Sexy code
public void Render(object sender, PaintEventArgs e)
{
if (_drawableObjects.Count < 1)
{
return;
}
Think();
Graphics g = e.Graphics;
foreach(DrawableObject d in _drawableObjects)
{
d.Draw(g);
}
}
I managed to draw a web of objects. Select, drag, drop and successfully made use of the IntersectsWith() method cracking over my collision boxes. GDI+ is a powerfull, productive API, but it’s a pity that besides the “draw this and that shape applications” no “real” examples are submitted.
Doug, Sam and Shawn blogged about PDC being expensive directly related to the fact who is responsible for your own career?
The question is “Where would I like to go” as John Maxwell notes in his book ‘Your road map for success”. Once you figured out what the previous sentence means you should ask yourself “What should I do along the way”.
Yes the PDC would be way over my budget not to mention my personal growth isn’t anywhere near the milestone (on my path) that would force me to attend.
I suggest reading “Your road map for success”. I can assure you the book brings more to those staying at home October 2003. Perhaps we’ll meet next year if our journeys collide. Perhaps I’ll take you along with me ;)
Ps: To the person who suggested this book, thank you for sharing this exceptional recourse!
To generalize or not to generalize that’s the question. The rule is only to generalize only if the entity in question has additional attributes over its super.
class Person
{
string _name;
}
class Employee : Person
{}
vs.
class Person
{
string _name;
Enums.Type _type;
}
For some reason this makes perfectly good sense in the domain in which I’m currently experimenting. Although it leaves me confused, mommy…
The last construction would save me a whole lot of time during the implementation phase regarding inheritance mapping, but… Good thing eXtreme Programming backs me up by encouraging “just making a decision NOW and revising later”. Typical Monday morning syndrome.
Seen some breathtaking nature, exceptional friendly locals, traditional lifestyle ann. 2003. In respect to your bandwidth only two shots, just for the taste of it ;)
View of Corfu (Kerkira) city, notice the old vest primarily used for protection against pirate attacks and later during the second world war against the Nazi’s.
A beautiful view over one of the bays down at Paleokastritsa. Damn, I would sign up for an office down there any day! Guess I’ll have to settle with having it as my desktop background for the moment.
More Posts