Permalink
Browse files

property getter

  • Loading branch information...
1 parent 88fa1c6 commit 4f7a570d07f3b2e7459a7f332f45271e07755c80 @salviati committed Aug 12, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 tmx/tmx.go
View
@@ -138,14 +138,24 @@ type PolyLine struct {
}
type Properties struct {
- Property []Property `xml:"property"`
+ Properties []Property `xml:"property"`
}
type Property struct {
Name string `xml:"name,attr"`
Value string `xml:"value,attr"`
}
+func (p *Properties) Get(name string) (value []string) {
+ value = make([]string, 0)
+ for _, prop := range p.Properties {
+ if prop.Name == name {
+ value = append(value, prop.Value)
+ }
+ }
+ return
+}
+
func (d *Data) decodeBase64() (data []byte, err error) {
rawData := bytes.TrimSpace(d.RawData)
r := bytes.NewReader(rawData)

0 comments on commit 4f7a570

Please sign in to comment.