Documentation
¶
Index ¶
- func IsOutside(instance gm.Object) bool
- type InstanceData
- type Room
- func (bhvr *Room) Data() gm.BehavioursData
- func (bhvr *Room) Draw(screen *ebiten.Image)
- func (bhvr *Room) InitObject(instance gm.Object, data InstanceData) gm.Object
- func (bhvr *Room) Instances() map[gm.Object]gm.Object
- func (bhvr *Room) Pause()
- func (bhvr *Room) PostInit()
- func (bhvr *Room) PreInit()
- func (bhvr *Room) Restart()
- func (bhvr *Room) Resume()
- type RoomsData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InstanceData ¶
type InstanceData struct { IsDeleteWhenOutside bool // contains filtered or unexported fields }
TODO: I don't feel convenince with this instance data model, because instance data is the data of instance that not have Room's behaviour.
The option that I think of is to put this data in Common as new field, or even in game as map[string]. I don't think the later will make the development easier, because there is no autocomplete that prevents typo, and we might need check isExist. Meanwhile the former will add bunch of other Behaviour instance data to Common that might not be used
The other option that I can think is with new behaviour called RoomInstance, then we can let this Room behaviour interact wirh RoomInstance behaviour. But I think this will be a little bit tedious, since I think every instance can be child of the Room.
If this case is true (every instance can be child of the Room), then it is a good idea to put this on the game package (as map[string]?), but again this is will prevent the ide for autocomplete. I think it's better to put in this instance data model for now.
func (*InstanceData) Parent ¶
func (data *InstanceData) Parent() gm.Object
func (*InstanceData) Room ¶
func (data *InstanceData) Room() *Room
type Room ¶
type Room struct { gm.Instancer Position r2.Point Size r2.Point // contains filtered or unexported fields }
func (*Room) Data ¶
func (bhvr *Room) Data() gm.BehavioursData
func (*Room) InitObject ¶
InitObject register current instance to this room. It is also register to gm through gm.InitObject().
type RoomsData ¶
var Data RoomsData
func (*RoomsData) ByInstance ¶
func (data *RoomsData) ByInstance(instID int) *InstanceData
func (*RoomsData) DelInstance ¶
func (*RoomsData) PostUpdate ¶
func (data *RoomsData) PostUpdate()