Documentation ¶
Index ¶
- Constants
- func Abs(x int) int
- func Max(x, y int) int
- func Min(x, y int) int
- func NewChessModel() *chessModel
- type AiPlayer
- type Chess
- type ChessBoard
- type ChessMenual
- type Game
- type GoBangTerm
- type GobangDB
- type HumanPlayer
- type Input
- type LRUCache
- type MenualItem
- type MenualKey
- type PieceType
- type Player
- type Position
- type Referee
- type Score
Constants ¶
View Source
const ( ScreenWidth = 800 ScreenHeight = 600 )
View Source
const ( ChessBoardSize = 600 PieceSize = 30 TopLeftX = 15 TopLeftY = 15 BlockSize = 39 )
View Source
const (
BucketName = "menual"
)
View Source
const (
GobangSize = 15
)
View Source
const (
JingShouRule bool = false
)
Variables ¶
This section is empty.
Functions ¶
func NewChessModel ¶
func NewChessModel() *chessModel
Types ¶
type AiPlayer ¶
type AiPlayer struct {
// contains filtered or unexported fields
}
func NewAiPlayer ¶
func NewAiPlayer(cb *ChessBoard, piece PieceType, menual *ChessMenual) *AiPlayer
type ChessBoard ¶
type ChessBoard [chessBoardSizeIn64Bit]uint64
func NewChessBoard ¶
func NewChessBoard() ChessBoard
func (*ChessBoard) Clear ¶
func (cb *ChessBoard) Clear()
func (*ChessBoard) Get ¶
func (cb *ChessBoard) Get(i, j int) PieceType
func (*ChessBoard) GetString ¶
func (cb *ChessBoard) GetString() string
func (*ChessBoard) Set ¶
func (cb *ChessBoard) Set(i, j int, piece PieceType)
type ChessMenual ¶
type ChessMenual struct {
// contains filtered or unexported fields
}
func NewChessMenual ¶
func NewChessMenual() *ChessMenual
func (*ChessMenual) CloseDB ¶
func (cm *ChessMenual) CloseDB()
func (*ChessMenual) Get ¶
func (cm *ChessMenual) Get(key MenualKey) *MenualItem
func (*ChessMenual) OpenDB ¶
func (cm *ChessMenual) OpenDB()
func (*ChessMenual) Put ¶
func (cm *ChessMenual) Put(key MenualKey, item *MenualItem)
type GoBangTerm ¶
type GoBangTerm int
const ( Huosan GoBangTerm = iota ChongSan HuoSi ChongSI WuZiLianZhu ChangLian ShuangHuoSan SanSanSheng SiSanSheng SiSiSheng ShuangSanJinShou ShuangSiJinShou HuoEr ChongEr JinShou Others )
type HumanPlayer ¶
type HumanPlayer struct {
// contains filtered or unexported fields
}
func NewHumanPlayer ¶
func NewHumanPlayer(cb *ChessBoard) *HumanPlayer
func (*HumanPlayer) Reset ¶
func (hp *HumanPlayer) Reset()
func (*HumanPlayer) Resolve ¶
func (hp *HumanPlayer) Resolve(p Position) Position
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
var (
DefaultInput *Input
)
func (*Input) GetClickPos ¶
type LRUCache ¶
func NewLRUCache ¶
func (*LRUCache) Get ¶
func (this *LRUCache) Get(key MenualKey) *MenualItem
func (*LRUCache) Put ¶
func (this *LRUCache) Put(key MenualKey, value *MenualItem)
type MenualItem ¶
type Referee ¶
type Referee struct {
// contains filtered or unexported fields
}
func NewRefree ¶
func NewRefree(cb *ChessBoard, players [2]Player) *Referee
Click to show internal directories.
Click to hide internal directories.