Documentation
¶
Index ¶
- func ApplySettings(req *proto_game.Server, settings *proto_game.Settings) *proto_game.Client
- func Center(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
- func DefaultSettings() *proto_game.Settings
- func Kan(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
- func Left(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
- func NoCenter(s *proto_game.Suggest)
- func NoChi(s *proto_game.Suggest)
- func NoKan(s *proto_game.Suggest)
- func NoLeft(s *proto_game.Suggest)
- func NoPon(s *proto_game.Suggest)
- func NoRight(s *proto_game.Suggest)
- func Pon(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
- func Right(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
- func Run(ctx context.Context, conn *grpc.ClientConn, token string, robot Robot) error
- type CallFunc
- type Caller
- type Client
- type DebugDecorator
- type Effective
- type Robot
- type Settings
- type SettingsDecorator
- type SuggestFunc
- type Tracker
- type Tsumo
- type Zaichik
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplySettings ¶
func ApplySettings(req *proto_game.Server, settings *proto_game.Settings) *proto_game.Client
func Center ¶
func Center(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
func DefaultSettings ¶
func DefaultSettings() *proto_game.Settings
func Kan ¶
func Kan(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
func Left ¶
func Left(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
func NoCenter ¶
func NoCenter(s *proto_game.Suggest)
func NoChi ¶
func NoChi(s *proto_game.Suggest)
func NoKan ¶
func NoKan(s *proto_game.Suggest)
func NoLeft ¶
func NoLeft(s *proto_game.Suggest)
func NoPon ¶
func NoPon(s *proto_game.Suggest)
func NoRight ¶
func NoRight(s *proto_game.Suggest)
func Pon ¶
func Pon(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
func Right ¶
func Right(c *Caller, req *proto_game.Server, res *proto_game.Client) bool
Types ¶
type CallFunc ¶
type CallFunc func(*Caller, *proto_game.Server, *proto_game.Client) bool
type Caller ¶
func (*Caller) Request ¶
func (c *Caller) Request(req *proto_game.Server) *proto_game.Client
type DebugDecorator ¶
type DebugDecorator struct {
// contains filtered or unexported fields
}
func NewDebugDecorator ¶
func NewDebugDecorator(robot Robot, f func(*proto_game.Server, *proto_game.Client)) *DebugDecorator
func (*DebugDecorator) Request ¶
func (d *DebugDecorator) Request(req *proto_game.Server) *proto_game.Client
type Effective ¶
type Effective struct {
Tracker
}
Effective is a robot, that uses uke-ire to build its hand. Declares riichi when ready. Note, that this robot does not know how to win. See SettingsDecorator.
func NewEffective ¶
func NewEffective() *Effective
func (*Effective) Request ¶
func (t *Effective) Request(req *proto_game.Server) *proto_game.Client
type Robot ¶
type Robot interface {
Request(*proto_game.Server) *proto_game.Client
}
type Settings ¶
type Settings struct { proto_game.Settings Remove []SuggestFunc }
type SettingsDecorator ¶
SettingsDecorator is a decorator, that could accept wins. Also could protect other implementations from making particular calls.
func NewSettingsDecorator ¶
func NewSettingsDecorator(c Robot, f ...SuggestFunc) *SettingsDecorator
func (*SettingsDecorator) Request ¶
func (d *SettingsDecorator) Request(req *proto_game.Server) *proto_game.Client
func (*SettingsDecorator) Update ¶
func (d *SettingsDecorator) Update(x *proto_game.Settings)
type SuggestFunc ¶
type SuggestFunc func(*proto_game.Suggest)
type Tracker ¶
type Tracker struct { Tsumo ClientIndex int64 Visible compact.Instances Melds []*proto_base.Meld Hand compact.Instances }
Tracker is a robot, tracking the hand state State is reset on a new round Use this robot as a helper struct, to implement others. Do not forget to pass every request to Tracker.
func NewTracker ¶
func NewTracker() Tracker
func (*Tracker) Request ¶
func (t *Tracker) Request(req *proto_game.Server) *proto_game.Client
type Tsumo ¶
type Tsumo struct { }
Tsumo is a Simple robot, rejecting all incomming suggest This should be a terminal decider of any robot
func (*Tsumo) Request ¶
func (t *Tsumo) Request(req *proto_game.Server) *proto_game.Client
type Zaichik ¶
type Zaichik struct {
Robot
}
Zaichik is a robot, that is gready to declare kans
func (*Zaichik) Request ¶
func (z *Zaichik) Request(req *proto_game.Server) *proto_game.Client
Click to show internal directories.
Click to hide internal directories.