[DGD]DGD and Melville

Nightlith nightlith at mb.sympatico.ca
Sat Jan 13 16:02:50 CET 2001


I've gone and fudged the code now, lol!


> On Thu, 11 Jan 2001, Nightlith wrote:
> > Is it possible to have creation.c inherit or include player.c instead?
>
> Not include. It is almost never correct (I am tempted
> to say literally never) to include code rather than
> inherit it. It duplicates the memory use and has no
> advantages that are coming to my mind.

Ok, no including.

> Inheriting it would work, except that then you'd have
> two different objects which acted like player bodies;
> one the one with the creation code (cloned from creation.c)
> and the other without (cloned from player.c). When you
> created a new character, you'd get the creation.c
> version of the body; subsequently, the other. Or you
> could do a body swap at the end of the creation
> process. It'd work, and it'd waste less memory,
> but it's aesthetically unpleasant, to me anyway.

I think I've started doing the hard method. I have user.c inherit creation.c
and login.c but something isn't working. I was looking through user.c and
login.c for some ideas and I have a question: how do those two function
access player.c functions? I don't see any cloning code, and from what I can
tell, the only place it could happen is by simply having
    static object player;
declared. What I have going is user.c having both login.c (to create/restore
a user) and creation.c (to create/restore the player). player.c inherits
living.c and creation.c is inherited after login.c. If I have player
declared in login, creation.c complains, and vice versa. Obviously, I don't
know what I'm doing :-)
How can I clone player so both login.c and creation.c get the
variables/functions they want? Just a tip. It's not fair to anyone if I'm
given the exact code.

Thanks again!
Dereck.


List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list