增加游戏开始/结束接口
This commit is contained in:
parent
e13f2730d5
commit
7fc5a76f18
@ -560,7 +560,12 @@ export class BattleHandler {
|
||||
* 一局游戏结束
|
||||
*/
|
||||
public onGameEnd(){
|
||||
|
||||
this._players.forEach((item: PlayerHandler) => {
|
||||
item.clear(true);
|
||||
});
|
||||
this._players.clear();
|
||||
this._playerids.clear();
|
||||
this._gamestart = false;
|
||||
};
|
||||
// end--------------------------------------------------
|
||||
|
||||
|
@ -379,11 +379,13 @@ export class PetHandler {
|
||||
return this._rebornskill != null && !this._isSilent && !this._hasreborned;
|
||||
};
|
||||
|
||||
public clear(){
|
||||
public clear(resetAll: boolean = false){
|
||||
if(this._halos.length > 0){
|
||||
this._halos.length = 0;
|
||||
this.clearEffHalos();
|
||||
this._owner.onHaloRemove(this);
|
||||
if(!resetAll){
|
||||
this._owner.onHaloRemove(this);
|
||||
}
|
||||
}
|
||||
this._waitskills.length = 0;
|
||||
};
|
||||
|
@ -45,8 +45,11 @@ export class PlayerHandler {
|
||||
this._unitcfg = this._playercfg && CfgMan.findUnitCfg(this._playercfg.herounit_id);
|
||||
};
|
||||
|
||||
public clear(){
|
||||
public clear(bresetAll: boolean = false){
|
||||
this._self = null;
|
||||
this._pets.forEach((item: PetHandler)=>{
|
||||
item.clear(bresetAll);
|
||||
});
|
||||
this._pets.length = 0;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user