make sequence generator independent of player
This commit is contained in:
@@ -328,7 +328,7 @@ local function _applyGameEnv(P)-- Finish gameEnv processing
|
|||||||
ENV.nextPos=false
|
ENV.nextPos=false
|
||||||
end
|
end
|
||||||
|
|
||||||
local seqGen=coroutine.create(getSeqGen(P))
|
local seqGen=coroutine.create(getSeqGen(ENV.sequence))
|
||||||
local seqCalled=false
|
local seqCalled=false
|
||||||
local initSZOcount=0
|
local initSZOcount=0
|
||||||
function P:newNext()
|
function P:newNext()
|
||||||
|
|||||||
@@ -223,8 +223,7 @@ local seqGenerators={
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
return function(P)-- Return a piece-generating function for player P
|
return function(s)-- Return a piece-generating function for player P
|
||||||
local s=P.gameEnv.sequence
|
|
||||||
if type(s)=='function' then
|
if type(s)=='function' then
|
||||||
return s
|
return s
|
||||||
elseif type(s)=='string' and seqGenerators[s] then
|
elseif type(s)=='string' and seqGenerators[s] then
|
||||||
@@ -235,7 +234,6 @@ return function(P)-- Return a piece-generating function for player P
|
|||||||
"No sequence mode called "..s or
|
"No sequence mode called "..s or
|
||||||
"Wrong sequence generator"
|
"Wrong sequence generator"
|
||||||
)
|
)
|
||||||
P.gameEnv.sequence='bag'
|
|
||||||
return seqGenerators.bag
|
return seqGenerators.bag
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user