rove/pkg/objects/objects.go

45 lines
722 B
Go
Raw Normal View History

package objects
const (
2020-06-30 23:59:58 +01:00
// Empty represents an non-existant object
Empty = byte(' ')
// Rover represents a live rover
Rover = byte('R')
// SmallRock is a small stashable rock
SmallRock = byte('o')
2020-06-30 23:59:58 +01:00
// LargeRock is a large blocking rock
LargeRock = byte('O')
)
2020-06-30 23:59:58 +01:00
// IsBlocking checks if an object is a blocking object
func IsBlocking(object byte) bool {
var blocking = [...]byte{
Rover,
LargeRock,
}
for _, t := range blocking {
if object == t {
return true
}
}
return false
}
2020-06-30 23:59:58 +01:00
// IsStashable checks if an object is stashable
func IsStashable(object byte) bool {
var stashable = [...]byte{
SmallRock,
}
for _, t := range stashable {
if object == t {
return true
}
}
return false
}