MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / Weather

Class Weather

PythonAPI/examples/dynamic_weather.py:85–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84
85class Weather(object):
86 def __init__(self, weather):
87 self.weather = weather
88 self._sun = Sun(weather.sun_azimuth_angle, weather.sun_altitude_angle)
89 self._storm = Storm(weather.precipitation)
90
91 def tick(self, delta_seconds):
92 self._sun.tick(delta_seconds)
93 self._storm.tick(delta_seconds)
94 self.weather.cloudiness = self._storm.clouds
95 self.weather.precipitation = self._storm.rain
96 self.weather.precipitation_deposits = self._storm.puddles
97 self.weather.wind_intensity = self._storm.wind
98 self.weather.fog_density = self._storm.fog
99 self.weather.wetness = self._storm.wetness
100 self.weather.sun_azimuth_angle = self._sun.azimuth
101 self.weather.sun_altitude_angle = self._sun.altitude
102
103 def __str__(self):
104 return '%s %s' % (self._sun, self._storm)
105
106
107def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected