EventManager

Started by
11 comments, last by Cybrosys 20 years, 9 months ago
quote:Original post by Cybrosys
The hole thing is i''m trying to write my code entirely oop. This means that there will be no functions outside classes.


Just because there are functions outside of your classes doesn''t mean you are steering clear of OOP. In fact, sometimes it''s quite the opposite.

quote:Original post by Cybrosys
Binding functions by using void points isnt doable if the function is in a class.


Wrong. Check out Boost.
--Michael Fawcett
Advertisement
quote:Original post by Cybrosys
Binding functions by using void points isnt doable if the function is in a class.


Read the last section of Enginuity part 2 (see my sig). It covers a ''functor'' object which can be used to wrap up a call to a function on an object.

All the functions have to be the same types (return types and parameters) but that''s not much of a problem.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

quote:Original post by superpig
Where's Enginuity 4!!! *cries bitterly*

I wouldn't get to torn up about straying a tiny little bit from a pure OOP implementation because, really, the only people in the world that really care if something is 100.42% OOP are CS professors, who are, in general, a bunch of old farts. You're not an old fart, are you, Jim .. err Cybrosys?

If it really chafes you to have loose functions flying around, do the Lua thing. Have functions in lua that will tell some sort of "lua->player control" wrapper class that the player is turning left/jumping/taking a pee. Have the lua script get events from your input class and have the script map these events to specific functions. Kind of an old style telephone operator plugging wires into holes solution, but it'd work, allow configuration in runtime and allow obsessives among us to maintain their sparkling OOP solution.

I think.

edit: Or functors. Functors are nice because they sound naughty.

[edited by - TSwitch on July 12, 2003 8:10:39 PM]
Member of the Unban nes8bit or the White Rhino in my Basement Gets Sold to the Highest Bidder Association (UNWRBGSHBA - Not accepting new members.)Member of the I'm Glad Mithrandir Finally Found an Association that Accepts People with his Past History Association (IGMFFAAPPHA)

This topic is closed to new replies.

Advertisement