CodeBase - Playing Card Loader: Using UDT Arrays & External Files - Standalone/Scalable

Return to the CodeBase listing

Category: Miscellaneous

Version: 1.1

0
0

Information

Uploaded: 26th Jun 2004 12:03

Modified: 27th Jun 2004 12:39

Author:  CattleRustler

Summary

Loads any number of Decks of Standard Playing Cards into a UDT Array from external files.

Full Description

This code needs only the included source file, and 4 external text files to run. The code shows how to use data stored in external files to build a deck, or multiple decks of standard playing cards, which are then held in a User Defined Type Array. Nothing is hard-coded in that changing the value in decks.txt will correctly build the Cards UDT Array. This code uses pure DBP Code for all of the logic and functionality. The included main source file makes use of my DBP_NETLIB Plugin's Variable Watcher feature for data viewing purposes only - It is NOT necessary that you have this plugin and any references to it can be remmed out in your main code. If you decide to use the DBP_NETLIB plugin it can be found at www.mod2software.com/dbp/dbp.htm (Please view the documents before using the DBP_NETLIB Plugin) The UDT in this code can easily be extended to include any set of elements you like which lends itself well to any type of 2D or 3D card game. Use a recursive random number generator and the Cards UDT Array IsUsed property to always draw unique/unsused cards from your created Deck(s).<br /> <br /> The attached code module (Include) can be dropped into any project as is. Your main code need only call the InitCardLoader() function to fully populate and build the deck(s) of cards.<br /> <br /> Thanks<br /> CattleRustler

Comments

No comments yet.