Skip to content

Commit

Permalink
Added values to RandDeck constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Mar 22, 2024
1 parent 31e2ed6 commit d49bd10
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dn/struct/RandDeck.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ class RandDeck<T> {
var rndFunc : Int->Int;
public var autoShuffle = true;

public function new(?rnd : Int->Int) {
public function new(?rnd : Int->Int, ?values:Array<T>) {
curIdx = 0;
size = 0;
rndFunc = rnd==null ? Std.random : rnd;
if( values!=null )
for(v in values)
push(v);
}

public function toString() {
Expand Down

0 comments on commit d49bd10

Please sign in to comment.