mccoyst / min-game

Automatically exported from code.google.com/p/min-game
MIT License
2 stars 1 forks source link

New Item representation. #103

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Items can't be interfaces or else they can't be JSON decoded.

Instead do:

type Item struct {
    Name string
    Uses int
}

var Descr = map[string]func(*Item)string{
   "Etele": func(i *Item) {
        return fmt.Sprintf("Teleporter, remaining uses %d", i.Uses)
    },

    ...
}

Original issue reported on code.google.com by burns.ethan@gmail.com on 11 Dec 2012 at 9:11

GoogleCodeExporter commented 9 years ago

Original comment by burns.ethan@gmail.com on 11 Dec 2012 at 9:12

GoogleCodeExporter commented 9 years ago

Original comment by burns.ethan@gmail.com on 11 Dec 2012 at 9:12

GoogleCodeExporter commented 9 years ago
This issue was closed by revision a726fcd01b28.

Original comment by burns.ethan@gmail.com on 12 Dec 2012 at 2:35