From 4fc18e23c740a7af05d52b80925090a02dca868d Mon Sep 17 00:00:00 2001 From: augustus Date: Sat, 25 Sep 2021 14:44:25 +0100 Subject: [PATCH] return temp as uint8 --- pkg/landscape/land.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/landscape/land.go b/pkg/landscape/land.go index 2982edb..ba04cd5 100644 --- a/pkg/landscape/land.go +++ b/pkg/landscape/land.go @@ -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. @@ -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), } }