Ive been peering over the code in my SWFotE base, and really after having looked at it now with some programming knowledge, I see the code differently than I did before. So, in looking at it is a Diku derivative like SMAUG or what-have-you written procedurally or in an OO format. I really dont see any OO going on. Correct me if I am wrong.
Are bases procedural or OO written
Posted by Npp83 on Thu 20 May 2010 07:25 AM — 4 posts, 19,673 views.
Smaug isn't particularly OO (it is pretty old). The MOO codebase is, hence its name.
Thats interesting. Thanks. Given the procedural nature of the code then, is there any method for gaining a better understanding of how the source is organized and related? The lot of the files all require mud.h but, for instance, what does mud.h contain that those files require. What I am looking for is a little organizational insight. Any thoughts or resources on how to start? Thanks again.
As I said in your crosspost over here:
http://www.smaugmuds.org/index.php?a=topic&t=4419&p=20720
To answer your new question, mud.h contains the necessary prototypes for functions, a few declarations for global variables, and such things. There is not really a strict organizational scheme although the file names will give you a nominal idea of what is supposed to go in there. E.g., act_comm.c contains stuff related to communication actions; act_wiz.c contains stuff related to wizard (i.e., imm) actions.
http://www.smaugmuds.org/index.php?a=topic&t=4419&p=20720
I said:
Diku is only 'accidentally' object oriented in places, but this is neither enforced nor really encouraged. You can write OO code in C, it's just that Diku didn't. I don't think that you need polymorphism to be considered object oriented (although if you have it, it's a pretty clear indication of at least some OO design), but you do need a stronger conception of objects and public interfaces to those objects.
Diku is only 'accidentally' object oriented in places, but this is neither enforced nor really encouraged. You can write OO code in C, it's just that Diku didn't. I don't think that you need polymorphism to be considered object oriented (although if you have it, it's a pretty clear indication of at least some OO design), but you do need a stronger conception of objects and public interfaces to those objects.
To answer your new question, mud.h contains the necessary prototypes for functions, a few declarations for global variables, and such things. There is not really a strict organizational scheme although the file names will give you a nominal idea of what is supposed to go in there. E.g., act_comm.c contains stuff related to communication actions; act_wiz.c contains stuff related to wizard (i.e., imm) actions.