Documentation ¶
Overview ¶
Copyright 2014 loolgame Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 loolgame Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. fsm.go
Copyright 2014 loolgame Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
src/robot 中是猜数字游戏机器人
Copyright 2014 loolgame Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 mqantserver Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func RandInt64(min, max int64) int64
- type FSM
- type FSMEvent
- type FSMHandler
- type FSMState
- type Table
- func (this *Table) AllowJoin() bool
- func (self *Table) Exit(session gate.Session) error
- func (this *Table) GetModule() module.RPCModule
- func (this *Table) GetSeats() []room.BasePlayer
- func (this *Table) GetViewer() *list.List
- func (this *Table) InitFsm()
- func (self *Table) Join(session gate.Session) error
- func (self *Table) NotifyAxes()
- func (self *Table) NotifyBetting()
- func (self *Table) NotifyIdle()
- func (self *Table) NotifyJoin(player *objects.Player)
- func (self *Table) NotifyOpening()
- func (self *Table) NotifyPause()
- func (self *Table) NotifyResume()
- func (self *Table) NotifySettlement(Result int64)
- func (self *Table) NotifyStop()
- func (this *Table) OnCreate()
- func (this *Table) OnDestroy()
- func (self *Table) OnNetBroken(player room.BasePlayer)
- func (this *Table) OnPause()
- func (this *Table) OnResume()
- func (this *Table) OnStart()
- func (this *Table) OnStop()
- func (self *Table) PauseGame(session gate.Session) error
- func (self *Table) SitDown(session gate.Session) error
- func (self *Table) Stake(session gate.Session, target int64) error
- func (self *Table) StartGame(session gate.Session) error
- func (this *Table) StateSwitch()
- func (self *Table) Update(arge interface{})
- func (this *Table) VerifyAccessAuthority(userId string, bigRoomId string) bool
Constants ¶
This section is empty.
Variables ¶
var ( VoidPeriod = FSMState("空档期") IdlePeriod = FSMState("空闲期") BettingPeriod = FSMState("押注期") OpeningPeriod = FSMState("开奖期") SettlementPeriod = FSMState("结算期") VoidPeriodEvent = FSMEvent("进入空档期") IdlePeriodEvent = FSMEvent("进入空闲期") BettingPeriodEvent = FSMEvent("进入押注期") OpeningPeriodEvent = FSMEvent("进入开奖期") SettlementPeriodEvent = FSMEvent("进入结算期") )
var Module = func() module.Module { this := new(xaxb) return this }
Functions ¶
Types ¶
type FSM ¶
type FSM struct {
// contains filtered or unexported fields
}
有限状态机
func (*FSM) AddHandler ¶
func (f *FSM) AddHandler(state FSMState, event FSMEvent, handler FSMHandler) *FSM
某状态添加事件处理方法
type FSMHandler ¶
type FSMHandler func() FSMState // 处理方法,并返回新的状态
type Table ¶
type Table struct { room.BaseTableImp room.QueueTable room.UnifiedSendMessageTable room.TimeOutTable VoidPeriodHandler FSMHandler IdlePeriodHandler FSMHandler BettingPeriodHandler FSMHandler OpeningPeriodHandler FSMHandler SettlementPeriodHandler FSMHandler // contains filtered or unexported fields }
func (*Table) GetSeats ¶
func (this *Table) GetSeats() []room.BasePlayer