types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Obstacle

type Obstacle interface {
	TankIsPassable() bool
	BulletIsPassable() bool
}

type TakeDamage

type TakeDamage interface {
	GetCamp() string
	TakeDamage(int)
}

可被伤害的 struct 需要实现此接口 GetCamp() string 获取阵营信息,相同阵营的不受影响。创建 tank 和 bullet 时需要携带阵营信息并存储 TakeDamage(int) 处理受伤操作,实例各自创建自己的受伤函数,由子弹调用

Jump to

Keyboard shortcuts

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