BasicDefinition

package
v0.0.0-...-75e9581 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ObjectCannotMove codes.Code = iota + 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicCapability

type BasicCapability int
const (
	CanBeMove BasicCapability = iota
	CanBeEat
	CanBeFill
)

type IContainerBasic

type IContainerBasic interface {
	IContainerPure
}

可以存放物品的容器

type IContainerPure

type IContainerPure interface {
	PutIn(IObjectBasic)                  //放物品進Container
	GetOut(string) (IObjectBasic, error) //從Container拿出來
	ItemListForDisplay() string          //列出內容物
	GetObjPoniter(num int, name string) (IObjectBasic, error)
}

可以存放物品的容器

type IObjectBasic

type IObjectBasic interface {
	GetObjectBasic() *ObjectBasic
	HaveCapability(cab BasicCapability) bool
}

type ObjectBasic

type ObjectBasic struct {
	ID                 string //GUID
	Name_EN            string //英文名,可以用來Get or Look,比如 Knife
	Name_CH            string //中文名,用來組合訊息用,比如小刀,可以用來顯示 xxx手持著小刀
	Level              int    //至少需要等級多少,才能使用該物品
	Description_List   string //在清單中的描述,比如,鈍掉的小刀
	Description_Ground string //在地上的描述,比如:一把在地上的小刀
	Description_Look   string //這是一把不怎麼利的小刀,可能沒啥用
	Weight             int    //重量
	Pricing            int    //售價

	//能力類
	Capability []BasicCapability //物件可允許的動作類別
	ObjectType ObjectType        //物件的䫴型,反序列化時,要依此類別製造物件

	//以下為未用到
	SystemCode           string //系統物件碼
	DestroyWhenZeroQuota bool
	AllowExecuteTimes    int
	Decoration           []string
}

func (*ObjectBasic) GetObjectBasic

func (o *ObjectBasic) GetObjectBasic() *ObjectBasic

func (*ObjectBasic) HaveCapability

func (o *ObjectBasic) HaveCapability(cab BasicCapability) bool

func (*ObjectBasic) SetObjectType

func (o *ObjectBasic) SetObjectType(objType ObjectType)

type ObjectType

type ObjectType int
const (
	Basic ObjectType = iota
	Container
	Fixed
)

func ParseObjectType

func ParseObjectType(objType string) ObjectType

func (ObjectType) String

func (c ObjectType) String() string

Jump to

Keyboard shortcuts

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