Magazin for preloading

M@gg!

27-08-2006 20:01:52

At the moment I'm programming three classes, that may be of more common interest.

First one is a Ogre::Singleton called MagazineStorage, the second is Magazine and the last is MagazineShell.

MagazineStorage holds Magazines of different bodys. For example for Rockets or what ever you can think of.

Magazine it self stores exact copies of the same body that was chosen during creation of the magazine. For example 500 Bullets.

MagazineShell is just for the management.

The aim of it is, that you can preload for example the bullets and when ever you need one, you can get it out of the magazine and let it automatically return when its livetime expires.

Currently I'm having some problems because the classes shall be as common as possible, but I think I'll find a satisfying solution.

What are you thinking? Would it be a nice to have thing?

M@gg!

16-09-2006 23:00:53

The Storagesystem is nearly ready, I'm testing it at the moment.

It is NxOgre independet but Ogre specific.

4 new classes

class MagazineStorage;
class Magazine;
class MagazineShell;
class StoreItem;

At the moment the initialising looks like this. More details and source code coming soon.



//Creating a MagazineStorage
mMagazineStorage = new MagazineStorage(mRoot, 10);
/*Creating a Magazine*/
Magazine *magazine = new Magazine(100);

/*Fill the magazine*/
MagazineShell *shell;
StoreItem *item;

while (shell = magazine->getUninitialisedShell())
{
item = new StoreItem();
item->setMagazineShell(shell);
shell->initializeShell(item);
}

/*Setting update flag*/
magazine->setUpdateFlag();
/*Put the magazine in the storage*/
mMagazineStorage->addMagazine(magazine);

betajaen

16-09-2006 23:32:00

Sounds good, I can't wait for the 3GB demo download, and the 90 minute movie with an extra commentry soundtrack. :wink:

M@gg!

17-09-2006 05:03:58

;-)