Skip to content

Commit

Permalink
return temp as uint8
Browse files Browse the repository at this point in the history
  • Loading branch information
augustus committed Sep 25, 2021
1 parent 3d5610e commit 4fc18e2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/landscape/land.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@ type Landscape struct {
// Area represents a specific small area of the map
type Area struct {
// 0-255, where higher is more/higher/better
Height uint8
Rainfall uint8
Vegetation uint8
Height uint8
Rainfall uint8
Vegetation uint8
Temperature uint8 // in degress c, offset so 100 => 0 degrees cel

// if the square contains fresh/salt water
Sea bool
River bool

// in degrees Cel.
Temperature int
}

// Dimensions returns the width & height of each map in pixels.
Expand All @@ -68,7 +66,7 @@ func (l *Landscape) At(x, y int) *Area {
Vegetation: l.vegetation.Value(x, y),
Sea: l.sea.Value(x, y) == 255,
River: l.rivers.Value(x, y) == 255,
Temperature: int(l.temperature.Value(x, y)) - 100,
Temperature: l.temperature.Value(x, y),
}
}

Expand Down

0 comments on commit 4fc18e2

Please sign in to comment.