logger
This commit is contained in:
+13
-8
@@ -1,6 +1,9 @@
|
||||
import { Logger } from "./logger";
|
||||
|
||||
class BcmTool {
|
||||
|
||||
private mgrTeamInfo = g_game.mgr.mgr_team_player_team_info;
|
||||
private logger = new Logger();
|
||||
|
||||
public queryPlayerInfo(playersToQuery:string[]) {
|
||||
const attributes = [
|
||||
['速度', 1],
|
||||
@@ -54,33 +57,35 @@ class BcmTool {
|
||||
console.log('找不到id', playerId);
|
||||
continue;
|
||||
}
|
||||
console.log(this.queryName(playerId));
|
||||
this.logger.Info(this.queryName(playerId));
|
||||
for (const info of attributes) {
|
||||
const name = info[0];
|
||||
const id = info[1];
|
||||
const record = this.queryInfo(playerId, id as number);
|
||||
console.log(name, record);
|
||||
this.logger.Info(name, record);
|
||||
}
|
||||
g_game.mgr.tools.CopyStrToClipboard(this.logger.GetOutput());
|
||||
this.logger.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public checkInfo(playerId:string) {
|
||||
const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId);
|
||||
const data = this.mgrTeamInfo.GetPlayerData(playerId);
|
||||
return data != null;
|
||||
}
|
||||
|
||||
public queryName(playerId:string) {
|
||||
const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId);
|
||||
const data = this.mgrTeamInfo.GetPlayerData(playerId);
|
||||
return data.playerName;
|
||||
}
|
||||
|
||||
public queryInfo(playerId:string, attri:number) {
|
||||
const data = g_game.mgr.mgr_team_player_team_info.GetPlayerData(playerId);
|
||||
return data.GetSingleAttribute(attri);
|
||||
const data = this.mgrTeamInfo.GetPlayerData(playerId);
|
||||
return data.GetSingleAttribute(attri).toFixed(2);
|
||||
}
|
||||
|
||||
public listPlayers() {
|
||||
const ids = Object.keys(g_game.mgr.mgr_team_player_team_info._map_player_detail);
|
||||
const ids = Object.keys(this.mgrTeamInfo._map_player_detail);
|
||||
for (const id of ids) {
|
||||
console.log(this.queryName(id), id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user