user_info

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

功能:手牌 说明:

功能:用户信息 说明:

功能:用户统计 说明:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandCard

type HandCard struct {
	// contains filtered or unexported fields
}

func NewHandCard

func NewHandCard() *HandCard

func (*HandCard) Append_card

func (h *HandCard) Append_card(card byte)

追加

func (*HandCard) Append_cards

func (h *HandCard) Append_cards(cards []byte)

func (*HandCard) Card_cnt

func (h *HandCard) Card_cnt() int

func (*HandCard) Card_type

func (h *HandCard) Card_type() CARD_TYPE.TYPE

获取牌型

func (*HandCard) Cards

func (h *HandCard) Cards() []byte

func (*HandCard) Double_down

func (h *HandCard) Double_down()

加倍停牌

func (*HandCard) Get_bet_amount

func (h *HandCard) Get_bet_amount() int

获取下注额

func (*HandCard) Get_score

func (h *HandCard) Get_score() float64

获取积分

func (*HandCard) Hand_type

func (h *HandCard) Hand_type() HAND_TYPE.TYPE

获取hand型

func (*HandCard) Is_result

func (h *HandCard) Is_result() bool

是否结算完成

func (*HandCard) Is_split

func (h *HandCard) Is_split() bool

是否分牌

func (*HandCard) Is_surrender

func (h *HandCard) Is_surrender() bool

是否投降

func (*HandCard) Set_bet_amount

func (h *HandCard) Set_bet_amount(bet_amount int)

设置下注额

func (*HandCard) Surrender

func (h *HandCard) Surrender()

投降

type UserInfo

type UserInfo struct {
	// contains filtered or unexported fields
}

func NewUserInfo

func NewUserInfo(user_type USER_TYPE.TYPE, init_chip float64) *UserInfo

func (*UserInfo) Current_hand

func (u *UserInfo) Current_hand() *HandCard

func (*UserInfo) Deal

func (u *UserInfo) Deal(cards []byte, bet_amount int)

发牌

func (*UserInfo) Extract_user_stat

func (u *UserInfo) Extract_user_stat() *UserStat

用户统计

func (*UserInfo) Get_chip

func (u *UserInfo) Get_chip() float64

获取筹码

func (*UserInfo) Get_init_chip

func (u *UserInfo) Get_init_chip() float64

获取起始筹码

func (*UserInfo) Get_profit

func (u *UserInfo) Get_profit() float64

利润

func (*UserInfo) Hand_cnt

func (u *UserInfo) Hand_cnt() int

手牌数

func (*UserInfo) Is_all_bust_or_surrender

func (u *UserInfo) Is_all_bust_or_surrender() (is bool, points []int, surrender_cnt int, bust_cnt int)

是否全部爆点/投降

func (*UserInfo) Next_hand

func (u *UserInfo) Next_hand() error

下一手

func (*UserInfo) Reset_hand_index

func (u *UserInfo) Reset_hand_index()

重置

func (*UserInfo) Split_card

func (u *UserInfo) Split_card(right_card byte) ([]byte, []byte)

分牌

func (*UserInfo) Update_score

func (u *UserInfo) Update_score(score float64)

更新积分

type UserStat

type UserStat struct {
	Total_bets int //总投注
	Lose_hands int //输的手数
	Push_hands int //和的手数
	Win_hands  int //赢的手数
}

func (UserStat) String

func (u UserStat) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL