Slimelite BBS

Constructors

Back to EMULATE

From Brian Wisti · 1996-04-11 15:08 · #73683 in EMULATE

-> Well, using private functions to carry out part of the construction
-> certainly seems like a valid approach to me.  Another possibility is
-> to try to abstract parts of the characteristics of a world into other
-> classes.  Without more specific information about the data you're
-> initializing in your ctor, it's a bit hard to say whether this is
-> likely
-> to work well or not.  One method that might work for this is to go by
-> the tables you're initializing, and starting with the assumption that
-> each of them probably represents a separate class of information.
->
-> One other item worth noting is that the tables used in many games are
-> each based on a mathematical formula or two.  On a computer it's
-> often easier to figure out the formula instead of initializing the
-> entire table.  If this is possible, it may reduce your ctors
-> considerably. Later,
-> Jerry.
->
-> ... The Universe is a figment of its own imagination.
->
-> --- PPoint 1.90
-> * Origin: Point Pointedly Pointless (1:128/77.3)

So it does look as if I had the right basic idea. Some of the tables do
show evidence of a formula being used, and it'll be a good idea to take
better advantage of that.
There are two reasons I didn't post code for this problem:

1) Legal Concerns - I'm uncertain as to whether it would constitute
copyright infringement to post material directly using info from a game
to a public area. It might not be a problem, but then again it might.

2)Embarassment -When I was reviewing the program for both this message
and the next stage of development, it occured to me that the class as it
was designed was almost impossible to expand via inheritance. There are
lots of classes in the program that will use some of the same basic
data, but too much of the class structure was relevant only to that
class. So I'll be redesigning the classes to something more flexible,
making MainWorld derive from a more general World class.

"Fiddle and tweak" isn't exactly the ideal method, but it does help me
learn the language!

--- WILDMAIL!/WC v4.12 
 * Origin: R-Squared BBS, Oly WA USA, 33k6bps, 360-705-4475  (1:352/28.0)