Home   Help Search Login Register  

Author Topic: The PlayingCard Library (ACCEPTED)  (Read 2749 times)

0 Members and 1 Guest are viewing this topic.

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
The PlayingCard Library (ACCEPTED)
« on: 16 Oct 2007, 16:15:22 »
This card library is modeled after the popular cards32.dll, if you've ever worked with cards32.dll then you will find this very similar. For those who don't know, the card library is meant as a helper for building card games, since this is written for Armed Assault, you can create playing cards type games using this simple library.


Included:
52 playing cards

Functions for:
      *returning card value
      *returning card suit
      *returning card text name
      *returning a shuffled deck
      *returning a custom shuffled deck
      *returning card back image path
      *returning cardimage path

Download CardLibrary
Enjoy!
« Last Edit: 12 Dec 2008, 01:36:31 by Spooner »
Xbox Rocks

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: The PlayingCard Library
« Reply #1 on: 16 Oct 2007, 18:22:46 »
Nice work, mate!

One thing though, in making it work like the windows dll, you are making it less pleasant to use for those of us that haven't used it in the dll form or that would prefer a more ArmA-native syntax. e.g. I think that:
Code: [Select]
["rtnCardTxtName", 32] call CardLib;

should be something like:
Code: [Select]
[32] call CardLibCardName;
(You might also like to make an OFPEC tag CARD_ or something, instead of using the CardLib prefix?)

If you changed the calling methods this way, then running CardLib.sqf would instead load the cardlib (as in "LoadLib" event) and set up all the necessary functions.

I noticed that you use local constants a lot, which you might as well use #defines for. Not something I'd usually hassle anyone about, but since you are already a programmer, I thought I'd point that out.
« Last Edit: 16 Oct 2007, 18:24:31 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: The PlayingCard Library
« Reply #2 on: 17 Oct 2007, 16:07:20 »
I thought about using a TAG, but I didn't think the library would be that popular. I know its not a very good reason, if I do update the Library part I will use a tag.
Xbox Rocks