Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UltimateBattleDescriptor haven't cloned timeLimit #31

Closed
khoanguyen-3fc opened this issue Aug 3, 2020 · 0 comments
Closed

UltimateBattleDescriptor haven't cloned timeLimit #31

khoanguyen-3fc opened this issue Aug 3, 2020 · 0 comments

Comments

@khoanguyen-3fc
Copy link

clone() {
let result = new UltimateBattleDescriptor();
result.setRngSeed(this.getRngSeed());
result.setTeamMode(this.getTeamMode());
let aiList = this.getAiList();
let aiClone;
for(let ai of aiList) {
aiClone = ai.clone();
result.addAiDefinition(aiClone);
}
return result;
}

so, createUltimateBattleDescriptor always have zero timeLimit

createUltimateBattleDescriptor() {
if(this._customFinishCondition) {
throw new Error('Cannot create UBD for battles with custom battle finish condition!');
}
return this._ultimateBattleDescriptor.clone();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants