Data Management for Management Game

Blitz3D Forums/Blitz3D Beginners Area/Data Management for Management Game

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ahh, containers.

This problem can be solved effectively with either vectors (arrays) or linked lists. Your solution is the simplest for Blitz Basic.

Note that if you want to allow less than the maximum number of items per array (e.g. a league with only 9 teams) you can either leave the unused slots NULL, or have an "exists" field for each object. Don't forget you'll need to test for unused slots anytime you loop through your objects.

You may also consider adding "parent" references. Being able to find out which team a player is on (given only a player object) or which team a league belongs to may be useful.

Given what you've told us you need to be able to do with your objects, there wouldn't be much benefit to using linked lists. There wouldn't be any drawbacks either, except for the added complexity involved in getting them to work in Blitz Basic. Personally, I'd use them anyways, but that's a matter of taste.