history

package
v0.0.0-...-19e6259 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type History

type History struct {
	SnapShot
	// contains filtered or unexported fields
}

func New

func New(deskID int64, mode int, name0, name1, name2, name3 string, basic *protocol.DeskBasicInfo, enter *protocol.PlayerEnterDesk, duan *protocol.DuanPai) *History

func (*History) PushAction

func (h *History) PushAction(op *protocol.OpTypeDo)

func (*History) PushGangScoreChange

func (h *History) PushGangScoreChange(g *protocol.GangPaiScoreChange) error

func (*History) PushHuScoreChange

func (h *History) PushHuScoreChange(hsc *protocol.HuInfo) error

func (*History) Save

func (h *History) Save() error

func (*History) SetEndStats

func (h *History) SetEndStats(ge *protocol.RoundOverStats) error

func (*History) SetScoreChangeForTurn

func (h *History) SetScoreChangeForTurn(turn uint8, sc int) error

type MatchStats

type MatchStats map[int64][]*Record

场统计

func (MatchStats) Push

func (ps MatchStats) Push(rs RoundStats) error

func (MatchStats) Result

func (ps MatchStats) Result() map[int64]*Record

func (MatchStats) Round

func (ps MatchStats) Round() int

type Record

type Record struct {
	ZiMoNum     int `json:"ziMo"`
	HuNum       int `json:"hu"`
	PaoNum      int `json:"pao"`
	MingGangNum int `json:"mingGang"`
	AnGangNum   int `json:"anGang"`
	TotalScore  int `json:"totalScore"`
}

type RoundStats

type RoundStats map[int64]*Record

局统计

type SnapShot

type SnapShot struct {
	Enter     *protocol.PlayerEnterDesk `json:"enter"`
	BasicInfo *protocol.DeskBasicInfo   `json:"basicInfo"`
	DuanPai   *protocol.DuanPai         `json:"duanPai"`
	End       *protocol.RoundOverStats  `json:"end"`

	// 如果在此遇到了gang操作就去GangScoreChanges中按序拿数据,
	// 如果遇到了hu就去HuScoreChanges中拿数据,
	// 即杠与和数据分开放
	Do []*protocol.OpTypeDo `json:"do"`

	GangScoreChanges []*protocol.GangPaiScoreChange `json:"gangScoreChanges"`
	HuScoreChanges   []*protocol.HuInfo             `json:"huScoreChanges"`
}

Jump to

Keyboard shortcuts

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