File: Games\Empires\Game.js

GamesByEmail
Class EmpiresBitArray

Object
  
 
 
GamesByEmail.EmpiresBitArray

All Implemented Interfaces:

Class


GamesByEmail.EmpiresBitArray

implements Foundation.Class

Constructor Summary
GamesByEmail.EmpiresBitArray()
// parentClass // null, // implement class (like interface I guess) //class contructor

Field Summary
static  b64Chars
// Position 0-63 is code for characters

Method Summary
static  b64decode(sChar)
static  b64encode()
// 01234567890123456789012345678901234567890123456789012345678901234 // The equal sign is just extra :)
 countRun()
//ASVPPPPPPPPPQFL //012345678901234 // iPos=3. // 12 ... 12-3=9.
 dispose()
 getBit()
// returns an int as 0 or 1
 getBitsAsInt(iStartBitPos, numBitsToUse)
 getRunLengthDecodedBase64Length()
//Count how many chars sData represents, accounting for Run-Length encoding.
static  leftShift()
//static methods
 pGetCharOffset()
//private
 reset()
 setBase64(sBase64Data)
 setBit()
//class methods //set a bit to zero or 1.
 setBitsToInt()
// Assume bitArray stores packed integers, lowest order bits // closest to 0 index. higher order bits get bigger as bitArray index grows // eg: 11 as binary is: 1011. // Suppose iStartBitPos is 3 of an 16 bit array // hi-end of array -> 00000000 01011000 <-0th index // | |
 setCompactString(sEncodedString, /*opt*/)
 setRleBase64()
//Preconditions: sRleBase64Data does not use padding. // It is either base64 data, or base64 data with run-length // encoded data. eg: SDF.ARgsd .AR is a run. the period is // a marker. A is the character to repeat. R is base64 encoded number // add 3 to R to get number of times to repeat the run. (map 4 to 0)
 toBase64()
//returns base64 encoded string //bOptSkipPadding: set to true to omit trailing equal sign padding. // default is false.
 toCompactString()
//returns entire array as a string.
 toRleBase64()
// Convert bits to base64 data, but wherever a run of 4 or more identical // base64 chars are found, encode them as where // numTimes is itself a base64 character. // This will compress runs of 4 up to 67 characters into 3 characters. // Remarks: No base64 padding is used.
 toString()
//returns entire array as a string. Adds a space every 8bits

Methods inherited from Foundation.Class
getTypePath, isInstanceOf

Constructor Detail

EmpiresBitArray

GamesByEmail.EmpiresBitArray()

// parentClass // null, // implement class (like interface I guess) //class contructor

Field Detail

b64Chars

static b64Chars

// Position 0-63 is code for characters

Method Detail

b64decode

static b64decode(sChar)
Parameters:
sChar - 


b64encode

static b64encode()

// 01234567890123456789012345678901234567890123456789012345678901234 // The equal sign is just extra :)


countRun

countRun()

//ASVPPPPPPPPPQFL //012345678901234 // iPos=3. // 12 ... 12-3=9.


dispose

dispose()
Overrides:
dispose in class Class

getBit

getBit()

// returns an int as 0 or 1


getBitsAsInt

getBitsAsInt(iStartBitPos,
             numBitsToUse)
Parameters:
iStartBitPos - 

numBitsToUse - 


getRunLengthDecodedBase64Length

getRunLengthDecodedBase64Length()

//Count how many chars sData represents, accounting for Run-Length encoding.


leftShift

static leftShift()

//static methods


pGetCharOffset

pGetCharOffset()

//private


reset

reset()

setBase64

setBase64(sBase64Data)
Parameters:
sBase64Data - 


setBit

setBit()

//class methods //set a bit to zero or 1.


setBitsToInt

setBitsToInt()

// Assume bitArray stores packed integers, lowest order bits // closest to 0 index. higher order bits get bigger as bitArray index grows // eg: 11 as binary is: 1011. // Suppose iStartBitPos is 3 of an 16 bit array // hi-end of array -> 00000000 01011000 <-0th index // | |


setCompactString

setCompactString(sEncodedString,
                 /*opt*/)
Parameters:
sEncodedString - 

/*opt*/ - 
iToCharOffset

setRleBase64

setRleBase64()

//Preconditions: sRleBase64Data does not use padding. // It is either base64 data, or base64 data with run-length // encoded data. eg: SDF.ARgsd .AR is a run. the period is // a marker. A is the character to repeat. R is base64 encoded number // add 3 to R to get number of times to repeat the run. (map 4 to 0)


toBase64

toBase64()

//returns base64 encoded string //bOptSkipPadding: set to true to omit trailing equal sign padding. // default is false.


toCompactString

toCompactString()

//returns entire array as a string.


toRleBase64

toRleBase64()

// Convert bits to base64 data, but wherever a run of 4 or more identical // base64 chars are found, encode them as where // numTimes is itself a base64 character. // This will compress runs of 4 up to 67 characters into 3 characters. // Remarks: No base64 padding is used.


toString

toString()

//returns entire array as a string. Adds a space every 8bits

Overrides:
toString in class Class