Created
November 2, 2012 17:47
-
-
Save jordanorelli/4003104 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type iStringer interface { | |
String(int) string | |
} | |
type tLibraryBase struct { | |
tBaseElement | |
elemCount int | |
elemName string | |
stringer func(int) iStringer | |
} | |
func (me *tBaseElement) initFromNode(xn *xmlx.Node) { | |
/* ... */ | |
} | |
type tVisualSceneDecl struct{} | |
func newVisualSceneDecl(xn *xmlx.Node) (f *tVisualSceneDecl) { | |
f = &tVisualSceneDecl{} | |
return | |
} | |
func (me *tVisualSceneDecl) String(indent int) (str string) { | |
str = "" | |
return | |
} | |
type tVisualSceneInst struct{} | |
func newVisualSceneInst(xn *xmlx.Node) (f *tVisualSceneInst) { | |
f = &tVisualSceneInst{} | |
return | |
} | |
type tPhysicsSceneDecl struct{} | |
func newPhysicsSceneDecl(xn *xmlx.Node) (f *tPhysicsSceneDecl) { | |
f = &tPhysicsSceneDecl{} | |
return | |
} | |
func (me *tPhysicsSceneDecl) String(indent int) (str string) { | |
str = "" | |
return | |
} | |
type tPhysicsSceneInst struct{} | |
func newPhysicsSceneInst(xn *xmlx.Node) (f *tPhysicsSceneInst) { | |
f = &tPhysicsSceneInst{} | |
return | |
} | |
type tLibraryPhysicsScenes struct { | |
tLibraryBase | |
Elements []*tPhysicsSceneDecl | |
} | |
func newLibraryPhysicsScenes(xn *xmlx.Node, elemName string) (l *tLibraryPhysicsScenes) { | |
l = &tLibraryPhysicsScenes{} | |
c := l.tLibraryBase.initLib(xn, elemName) | |
l.Elements = make([]*tPhysicsSceneDecl, len(c)) | |
l.tLibraryBase.stringer = func(index int) iStringer { return l.Elements[index] } | |
for i, n := range c { | |
l.Elements[i] = newPhysicsSceneDecl(n) | |
} | |
return | |
} | |
type tLibraryVisualScenes struct { | |
tLibraryBase | |
Elements []*tVisualSceneDecl | |
} | |
func newLibraryVisualScenes(xn *xmlx.Node, elemName string) (l *tLibraryVisualScenes) { | |
l = &tLibraryVisualScenes{} | |
c := l.tLibraryBase.initLib(xn, elemName) | |
l.Elements = make([]*tVisualSceneDecl, len(c)) | |
l.tLibraryBase.stringer = func(index int) iStringer { return l.Elements[index] } | |
for i, n := range c { | |
l.Elements[i] = newVisualSceneDecl(n) | |
} | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment