mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-16 17:35:57 -05:00
5e0e51d5e2
* Adding setters/getters so that state management can be maintained internally when the ds1 struct is altered * Adding unit tests for DS1
26 lines
485 B
Go
26 lines
485 B
Go
package d2ds1
|
|
|
|
import (
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2path"
|
|
)
|
|
|
|
// Object is a game world object
|
|
type Object struct {
|
|
Type int
|
|
ID int
|
|
X int
|
|
Y int
|
|
Flags int
|
|
Paths []d2path.Path
|
|
}
|
|
|
|
// Equals checks if this Object is equivalent to the given Object
|
|
func (o *Object) Equals(other *Object) bool {
|
|
return o.Type == other.Type &&
|
|
o.ID == other.ID &&
|
|
o.X == other.X &&
|
|
o.Y == other.Y &&
|
|
o.Flags == other.Flags &&
|
|
len(o.Paths) == len(other.Paths)
|
|
}
|