-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclass.go
37 lines (30 loc) · 893 Bytes
/
class.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
package main
import "strings"
type Class struct {
Name string `json:"name"`
Description string `json:"description"`
Constructor Constructor `json:"constructor"`
Functions []Function `json:"functions"`
Members []Member `json:"members"`
Imports map[string]string `json:"-"`
}
func (c *Class) GetNamespace() string {
/*lastPoint := strings.LastIndex(c.Name, ".")
if lastPoint != -1 {
return c.Name[0:lastPoint]
}
return ""*/
return "phaser"
}
func (c *Class) GetPackage() string {
return strings.Replace(c.GetNamespace(), ".", "/", -1)
}
func (c *Class) GetNameNoNamespace() string {
return TypeNoNamespace(c.Name)
}
func (c *Class) GetFirstDescriptionLine() string {
return FirstDescriptionLine(c.Description)
}
func (c *Class) GetNextDescriptionLines() []string {
return NextDescriptionLines(c.Description)
}