|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
Provides random indexes to an array.
Not thread safe
Field Summary | |
---|---|
bool | autoReset |
int | givenOut |
bool[] | indexes |
System.Random | r |
Constructor Summary | |
---|---|
RandomArrayCrawler(int length, bool autoReset) Constructor |
Method Summary | |
---|---|
int |
GetIndex() Gets a random index. If autoReset is false and there are no more indexes, -1 is returned |
void |
Reset() Reset indexes (old numbers are then re-used) |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Field Detail |
---|
private bool autoReset
private int givenOut
private bool[] indexes
private System.Random r
Constructor Detail |
---|
public RandomArrayCrawler(int length, bool autoReset)
Constructor
Parameters:
length
- Number of indexesautoReset
- Should numbers wrap-around automaticallyMethod Detail |
---|
public int GetIndex()
Gets a random index. If autoReset is false and there are no more indexes, -1 is returned
Returns:
public void Reset()
Reset indexes (old numbers are then re-used)
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |