MODULE: TBitField v1.0

Started by Terrorcell, Thu 13/06/2013 09:32:38

Previous topic - Next topic

Terrorcell

The TBitField Module

So this is my first module and it's something that I've used a few times before but haven't seen on the forums so far, so I decided to put it up on here.
If anyone has any suggestions or criticisms, then have at it :) I always welcome constructive feedback.

What is it?
It's a pretty basic struct with some bit manipulation functionality. Usually I use it to mask flags to save memory (just for fun), hence the name.
Sometimes bitwise operators all over the place can look a bit dirty, so maybe this will clean some of it up at least.

How do I use it?
Code: AGS

TMASK mask = 10; // can be any number from 0 to 255
TBitField field;
field.setMask(mask); // or just field.setMask(10) if you so desire
// away you go

In case the method names aren't clear enough, or if you just want to be sure, I've provided documentation with the module.

Where can I get it?
Works with AGS 2.71 and above.
Current version: TBitField Module v1.0
Mirror: TBitField Module v1.0

SMF spam blocked by CleanTalk