mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-12-27 04:26:29 -05:00
d2dat: add New method for DATPalette
This commit is contained in:
parent
5efe96ebe3
commit
5962d2e832
@ -15,6 +15,15 @@ type DATPalette struct {
|
||||
colors [numColors]d2interface.Color
|
||||
}
|
||||
|
||||
func New() *DATPalette {
|
||||
result := &DATPalette{}
|
||||
for i := range result.colors {
|
||||
result.colors[i] = &DATColor{}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// NumColors returns the number of colors in the palette
|
||||
func (p *DATPalette) NumColors() int {
|
||||
return len(p.colors)
|
||||
|
Loading…
Reference in New Issue
Block a user