-
Notifications
You must be signed in to change notification settings - Fork 0
/
hud_node_content.go
50 lines (41 loc) · 997 Bytes
/
hud_node_content.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package opengl
type hudNodeContent struct {
model Model
display HudDisplay
}
func createHudNodeContentWithModel(
model Model,
) HudNodeContent {
return createHudNodeContentInternally(model, nil)
}
func createHudNodeContentWithDisplay(
display HudDisplay,
) HudNodeContent {
return createHudNodeContentInternally(nil, display)
}
func createHudNodeContentInternally(
model Model,
display HudDisplay,
) HudNodeContent {
out := hudNodeContent{
model: model,
display: display,
}
return &out
}
// IsModel returns true if there is a model, false otherwise
func (obj *hudNodeContent) IsModel() bool {
return obj.model != nil
}
// Model returns the model, if any
func (obj *hudNodeContent) Model() Model {
return obj.model
}
// IsDisplay returns true if there is a display, false otherwise
func (obj *hudNodeContent) IsDisplay() bool {
return obj.display != nil
}
// Display returns the display, if any
func (obj *hudNodeContent) Display() HudDisplay {
return obj.display
}