hitball

package
v0.0.0-...-ce26905 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

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.

* 一定要记得在confin.json配置这个模块的参数,否则无法使用

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

Constants

This section is empty.

Variables

View Source
var Module = func() module.Module {
	gate := new(Hitball)
	return gate
}

Functions

func GetRandomString

func GetRandomString(lenght int) string

生成随机字符串

Types

type BaseTable

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

func (*BaseTable) ExecuteEvent

func (self *BaseTable) ExecuteEvent(arge interface{})

* 【每帧调用】执行队列中的所有事件

func (*BaseTable) Init

func (self *BaseTable) Init()

func (*BaseTable) PutQueue

func (self *BaseTable) PutQueue(_func string, params ...interface{}) error

* 协成安全,任意协成可调用

func (*BaseTable) Register

func (self *BaseTable) Register(id string, f interface{})

func (*BaseTable) SetReceive

func (self *BaseTable) SetReceive(receive QueueReceive)

type CallBackMsg

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

type Hitball

type Hitball struct {
	basemodule.BaseModule
	// contains filtered or unexported fields
}

func (*Hitball) GetType

func (self *Hitball) GetType() string

func (*Hitball) OnDestroy

func (self *Hitball) OnDestroy()

func (*Hitball) OnInit

func (self *Hitball) OnInit(app module.App, settings *conf.ModuleSettings)

func (*Hitball) Run

func (self *Hitball) Run(closeSig chan bool)

func (*Hitball) Version

func (self *Hitball) Version() string

type QueueMsg

type QueueMsg struct {
	Func   string
	Params []interface{}
}

type QueueReceive

type QueueReceive interface {
	Receive(msg *QueueMsg, index int)
}

type Room

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

func NewRoom

func NewRoom(module module.Module) *Room

func (*Room) GetEmptyTable

func (self *Room) GetEmptyTable() (*Table, error)

func (*Room) GetTable

func (self *Room) GetTable(tableId int) *Table

type Table

type Table struct {
	BaseTable
	// contains filtered or unexported fields
}

func NewTable

func NewTable(module module.Module, tableId int) *Table

func (*Table) Empty

func (self *Table) Empty() bool

func (*Table) Full

func (self *Table) Full() bool

func (*Table) NotifyAddCoins

func (self *Table) NotifyAddCoins(coins *objects.Coins)

* 通知所有玩家新加了金币

func (*Table) NotifyAxes

func (self *Table) NotifyAxes(arge interface{})

* 定期刷新所有玩家的位置

func (*Table) NotifyEatCoins

func (self *Table) NotifyEatCoins(coins *objects.Coins)

* 通知所有玩家金币已经被吃掉

func (*Table) NotifyJoin

func (self *Table) NotifyJoin(player *objects.Player)

* 通知所有玩家有新玩家加入

func (*Table) Start

func (self *Table) Start()

func (*Table) Stop

func (self *Table) Stop()

func (*Table) TableId

func (self *Table) TableId() int

func (*Table) Update

func (self *Table) Update(arge interface{})

* 定帧计算所有玩家的位置

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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