squidGame/tgx-games-client/assets/module_arean/scripts/AreanPlayer.ts

97 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { IAreanPlayer } from "../../module_basic/shared/protocols/public/arean/AreanTypeDef";
import { AreanNetMgr } from "./AreanNetMgr";
export class AreanPlayer {
/**
* 玩家名字
*/
name: string;
/**
* 是否准备好
*/
isReady: boolean;
/**
* 玩家ID每次进入房间都会不一样
*/
playerId: number;
/**
* 英雄
*/
heroId: number;
/**
* 职业
*/
careerId: number;
/**
* 血量
*/
bloodVolume: number;
/**
* money
*/
money: number;
/**
* 等级
*/
lv: number;
/**
* 经验
*/
exp: number;
/**
* 锁定列表
*/
listLock: boolean
constructor(player: IAreanPlayer) {
this.onPlayerDataChange(player);
}
/**
* 修改角色所有属性
* @param _player
*/
onPlayerDataChange(_player: IAreanPlayer) {
//console.log("onPlayerDataChange",_player, _player.moraleLevel,_player.currSeatCount);
this.name = _player.nickname;
this.isReady = _player.isReady;
this.playerId = _player.playerId;
this.heroId = _player.heroId;
this.careerId = _player.careerId;
this.bloodVolume = _player.bloodVolume;
this.money = _player.money;
this.lv = _player.lv;
this.exp = _player.exp;
this.listLock = _player.listLock;
}
/**
* 准备
* @param isReady
*/
public setReady(isReady: boolean) {
AreanNetMgr.inst.sendMsg_StartGame();
}
}