Documentation ¶
Index ¶
- Variables
- func AddPlayResult(sv IService, pr *sgc7pb.ReplyPlay, results []*sgc7game.PlayResult)
- type BasicService
- type BasicService2
- type Client
- func (client *Client) GetConfig(ctx context.Context) (*sgc7pb.GameConfig, error)
- func (client *Client) Initialize(ctx context.Context) (*sgc7pb.PlayerState, error)
- func (client *Client) Play(ctx context.Context, ps *sgc7pb.PlayerState, cheat string, stake *sgc7pb.Stake, ...) (*sgc7pb.ReplyPlay, error)
- type IService
- type Serv
- func (serv *Serv) GetConfig(ctx context.Context, req *sgc7pb.RequestConfig) (*sgc7pb.GameConfig, error)
- func (serv *Serv) Initialize(ctx context.Context, req *sgc7pb.RequestInitialize) (*sgc7pb.PlayerState, error)
- func (serv *Serv) LogReplyPlay(str string, reply *sgc7pb.ReplyPlay, logLevel zapcore.Level)
- func (serv *Serv) Play(req *sgc7pb.RequestPlay, stream sgc7pb.DTGameLogic_PlayServer) error
- func (serv *Serv) ProcCheat(plugin sgc7plugin.IPlugin, cheat string) error
- func (serv *Serv) Start(ctx context.Context) error
- func (serv *Serv) Stop()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidBasicPlayerState - invalid BasicPlayerState ErrInvalidBasicPlayerState = errors.New("invalid BasicPlayerState") )
Functions ¶
func AddPlayResult ¶
func AddPlayResult(sv IService, pr *sgc7pb.ReplyPlay, results []*sgc7game.PlayResult)
AddPlayResult - []*sgc7game.PlayResult => *PlayResult
Types ¶
type BasicService ¶
type BasicService struct { }
BasicService - BasicService
func (*BasicService) BuildPBPlayerState ¶
func (bs *BasicService) BuildPBPlayerState(ps sgc7game.IPlayerState) (*sgc7pb.PlayerState, error)
BuildPBPlayerState - sgc7game.IPlayerState -> *sgc7pb.PlayerState
func (*BasicService) BuildPlayerStateFromPB ¶
func (bs *BasicService) BuildPlayerStateFromPB(ps sgc7game.IPlayerState, pspb *sgc7pb.PlayerState) error
BuildPlayerStateFromPB - *sgc7pb.PlayerState -> sgc7game.IPlayerState
type BasicService2 ¶
type BasicService2 struct { }
BasicService2 - BasicService2
func (*BasicService2) BuildPBPlayerState ¶
func (bs *BasicService2) BuildPBPlayerState(ps sgc7game.IPlayerState) (*sgc7pb.PlayerState, error)
BuildPBPlayerState - sgc7game.IPlayerState -> *sgc7pb.PlayerState
func (*BasicService2) BuildPlayerStateFromPB ¶
func (bs *BasicService2) BuildPlayerStateFromPB(ps sgc7game.IPlayerState, pspb *sgc7pb.PlayerState) error
BuildPlayerStateFromPB - *sgc7pb.PlayerState -> sgc7game.IPlayerState
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client - DTGameLogicClient
func (*Client) Initialize ¶
Initialize - initialize a player
type IService ¶
type IService interface { // BuildPlayerStateFromPB - *sgc7pb.PlayerState -> sgc7game.IPlayerState BuildPlayerStateFromPB(ps sgc7game.IPlayerState, pspb *sgc7pb.PlayerState) error // BuildPBPlayerState - sgc7game.IPlayerState -> *sgc7pb.PlayerState BuildPBPlayerState(ps sgc7game.IPlayerState) (*sgc7pb.PlayerState, error) // BuildPBGameModParam - any -> *any.Any BuildPBGameModParam(gp any) (*anypb.Any, error) // BuildPBGameModParamFromAny - any -> *any.Any BuildPBGameModParamFromAny(msg *anypb.Any) (any, error) }
IService - service
type Serv ¶
type Serv struct { sgc7pb.UnimplementedDTGameLogicServer // contains filtered or unexported fields }
Serv - DreamTech Service
func (*Serv) GetConfig ¶
func (serv *Serv) GetConfig(ctx context.Context, req *sgc7pb.RequestConfig) (*sgc7pb.GameConfig, error)
GetConfig - get config
func (*Serv) Initialize ¶
func (serv *Serv) Initialize(ctx context.Context, req *sgc7pb.RequestInitialize) (*sgc7pb.PlayerState, error)
Initialize - initialize a player
func (*Serv) LogReplyPlay ¶
Play - play game
func (*Serv) Play ¶
func (serv *Serv) Play(req *sgc7pb.RequestPlay, stream sgc7pb.DTGameLogic_PlayServer) error
Play - play game
Click to show internal directories.
Click to hide internal directories.