[Include] mBits - better than Booleans
#10

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
I mean, it seems a lot easier for beginners to read a code like this:

Код:
new bool:bool;

if(!bool)
than something like this

Код:
new mybit;

if(IsBit(mybit, 0))
Use of binary data storage variable, by using only one bit is meaningless. So you create one variable anyway.
For example this include is good when you save such a boolean values in the database.

Quote:
Originally Posted by Alcatrik
Посмотреть сообщение
you could eliminate your defines by bitshifting 1 left by setid (1 << setid) in your methods.
Slower code compilation vs execution. This solution adds further calculations for the processor during execution.

Quote:
Originally Posted by Macluawn
Посмотреть сообщение
How does this differ from rBits (https://sampforum.blast.hk/showthread.php?tid=275142) ?
I didnt know that include, but when I read theard I can say that the difference is simplicity for my include and functionality for rBits.

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
BitFunction is simpler and faster.

https://sampforum.blast.hk/showthread.php?tid=591223
Please show me the code and results.


Update to version 1.1
- removed "Bit:" flags
- stocks rewrited to defines
- SetBit is now SetBitTrue and SetBitFalse
- parameters is now "var" and "bit" (old = "bits" and "setid");
Reply


Messages In This Thread
mBits - better than Booleans - by MakuPL - 04.02.2016, 17:01
Re: mBits - better than Booleans - by Yashas - 04.02.2016, 17:08
Re: mBits - better than Booleans - by Pottus - 04.02.2016, 17:13
Re: mBits - better than Booleans - by Slice - 04.02.2016, 17:45
Re: mBits - better than Booleans - by MakuPL - 04.02.2016, 19:01
Re: mBits - better than Booleans - by TakeiT - 04.02.2016, 20:50
Re: mBits - better than Booleans - by Alcatrik - 04.02.2016, 20:52
Re: mBits - better than Booleans - by Macluawn - 04.02.2016, 21:11
Re: mBits - better than Booleans - by AbyssMorgan - 05.02.2016, 05:52
Re: mBits - better than Booleans - by MakuPL - 05.02.2016, 13:42

Forum Jump:


Users browsing this thread: 2 Guest(s)