Merge branch 'second' of http://git.kingsome.cn/node/card_svr into second
This commit is contained in:
commit
e0b300c064
@ -56,6 +56,8 @@ export class GameEnv {
|
||||
public otherEatCount: number;
|
||||
// 轮空轮的间隔时间
|
||||
public emptyRoundTime: number;
|
||||
// 玩家初始卡牌数
|
||||
public playerInitNums: number[] = [];
|
||||
|
||||
public init(data: Map<number, BaseCfg>) {
|
||||
this.initCardNum = data.get(BaseConst.INIT_CARD_NUM).value;
|
||||
@ -84,5 +86,11 @@ export class GameEnv {
|
||||
this.selfEatCount = data.get(BaseConst.SELF_EAT_COUNT).value;
|
||||
this.otherEatCount = data.get(BaseConst.OTHER_EAT_COUNT).value;
|
||||
this.emptyRoundTime = data.get(BaseConst.EMPTY_ROUND_TIME).value;
|
||||
this.playerInitNums = [
|
||||
data.get(BaseConst.PLAYER1_INIT_NUM).value,
|
||||
data.get(BaseConst.PLAYER2_INIT_NUM).value,
|
||||
data.get(BaseConst.PLAYER3_INIT_NUM).value,
|
||||
data.get(BaseConst.PLAYER4_INIT_NUM).value,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +51,11 @@ export class BaseConst {
|
||||
public static readonly OTHER_EAT_COUNT = 99025
|
||||
// 轮空轮的间隔时间
|
||||
public static readonly EMPTY_ROUND_TIME = 99026
|
||||
// 各玩家初始卡牌数
|
||||
public static readonly PLAYER1_INIT_NUM = 99027
|
||||
public static readonly PLAYER2_INIT_NUM = 99028
|
||||
public static readonly PLAYER3_INIT_NUM = 99029
|
||||
public static readonly PLAYER4_INIT_NUM = 99030
|
||||
|
||||
|
||||
|
||||
|
@ -20,8 +20,9 @@ export class BeginGameCommand extends Command<CardGameState, {}> {
|
||||
let cardAll = card0.concat(card1);
|
||||
cardAll.randomSort();
|
||||
this.state.cardQueue = cardAll;
|
||||
let i = 1;
|
||||
for (let [id] of this.state.players) {
|
||||
this.room.addCard(id, new GameEnv().initCardNum, 0);
|
||||
this.room.addCard(id, new GameEnv().playerInitNums[i++], 0);
|
||||
}
|
||||
this.state.updateGameState(GameStateConst.STATE_CHANGE_CARD);
|
||||
// 超时后结束换卡, 进入下一轮
|
||||
|
Loading…
x
Reference in New Issue
Block a user