From: Charles M. <cha...@ya...> - 2002-06-12 12:35:41
|
I got the liquid dirt to work with a few tweaks to the NapalmExplosion. (By the way... I still don't know 1/2 of how things are working in the class. There are a lot of things in the base APIs that when I go to them via code they don't explain what they are or used for.... which leads to more digging and looking to try to understand. However, I understand enought to create this new class.) Anyway, I started going down the path of handling more than 1 argument... public void setArguments(Object args[]) The negative with this is that each class will pass in a varying amount of arguments, all of different types. It makes it more difficult for the developer when they are coding to understand what is being used. This also requires us to case a int to a Integer and then back to a int. If you don't mind these shortcomings, then I'll continue to move forward. At a minimum, each explosion class that implements this method should describe the input expected as the API. > > > > I think I have a better idea. I kind of like the fact that > > > produceExplosion is so generic and that weapon class doesn't have to > > > implement any methods. The solution I have in mind is to make argument an > > > Object isntead of int. For example MIRVExplosion needs really 2 arguments: > > > number of particles and radius. Then the object passed to is as arument > > > would be an array of two ints. This might introduce some weird relation > > > ship between Weapon and Explosion class, but it looks good to me. At least > > > at 3am. Let me know what you think about this idea. > > > __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com |