game_sync/gamerule/chess/constants.go

81 lines
2.1 KiB
Go
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.

package chess
import "time"
const (
TestOpen bool = false //测试开关
MaxNumOfPlayer int = 2 //最多人数
InvalidPos int = -1
PlayerStepLimit = 64 // 残局计步最大回合数
)
const (
WaitStartTimeout = time.Second * 3 // 开始游戏
HandCardTimeout = time.Second * 1 // 发牌
PlayerOpTimeout = time.Second * 61 // 玩家操作阶段
BilledTimeout = time.Second * 1 // 结算
PlayerFirstOpTimeout = time.Second * 31
PlayerTotalTime = time.Minute*10 + time.Second // 下棋总时长
)
// 场景状态
const (
SceneStateWaitPlayer int = iota // 等待玩家
SceneStateWaitStart // 开始游戏
SceneStateChessInit // 发送棋盘数据
SceneStatePlayerOp // 玩家操作
SceneStateBilled // 结算
SceneStateMax
)
// 玩家操作
const (
PlayerOpNull int32 = iota //0,初始值
PlayerOpPlay //1,出牌
PlayerOpPass //2,过牌
PlayerOpStart //3,房主开始游戏
PlayerOpSurrender //4, 投降操作
PlayerOpTest //5, 测试
PlayerOpStep //6,计步操作(1 开始0结束)
PlayerOpDraw //7,求和 1请求求和 2拒绝求和 3同意求和
PlayerOpNextPlay //8,再来一局
PlayerOpWin //9,胜利
// 人机对战操作
PlayerOpAISwitch //9,ai开关 0关闭 1开启
PlayerOpAIRestart //10,重新开始
PlayerOpAISwap //11,黑白互换
PlayerOpAISuggest //12,建议下一步
PlayerOpAIBack //13,悔棋一步
)
const (
BilledTypeRobot = 1 // 人机对战
BilledTypeGT = 2 // 我方段位大于对方段位
BilledTypeEQ = 3 // 我方段位等于对方段位
BilledTypeLT = 4 // 我方段位小于对方段位
BilledTypeMatch = 5 // 比赛场
)
const (
Win = 1 // 赢
Lose = 2 // 输
Draw = 0 // 平
)
const (
RequestDraw = 1 // 请求求和
RefuseDraw = 2 // 拒绝求和
AgreeDraw = 3 // 同意求和
CancelDraw = 4 // 撤销求和
)
const (
StepCancel = 0 // 取消计步
StepStart = 1 // 开始计步
)
const (
StaticsChessTime = "chesstimes"
)