2022-10-23 00:57:23 -07:00
|
|
|
package command
|
2022-10-22 02:00:29 -07:00
|
|
|
|
|
|
|
// List of keys supported by all entities
|
|
|
|
const (
|
2022-10-23 00:57:23 -07:00
|
|
|
MOVE_X int = iota
|
|
|
|
MOVE_Y
|
|
|
|
SET_SPEED
|
|
|
|
SET_POSITION
|
|
|
|
SET_ANIMATION
|
2022-10-22 02:00:29 -07:00
|
|
|
)
|
|
|
|
|
2022-10-23 21:28:38 -07:00
|
|
|
type Command struct {
|
2022-10-22 02:00:29 -07:00
|
|
|
key int
|
2022-11-22 00:08:00 -08:00
|
|
|
value float32
|
2022-10-22 02:00:29 -07:00
|
|
|
}
|
|
|
|
|
2022-11-22 00:08:00 -08:00
|
|
|
func NewCommand(key int, value float32) Command {
|
2022-10-23 21:28:38 -07:00
|
|
|
return Command{
|
2022-10-22 02:00:29 -07:00
|
|
|
key: key,
|
|
|
|
value: value,
|
|
|
|
}
|
|
|
|
}
|