Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Weather.WeatherForecast Class Reference

Public Member Functions

void Add (Condition con, int h)
 
void Finish ()
 

Public Attributes

Date date
 
Dictionary< Condition, int > cons = new Dictionary<Condition, int>()
 

Detailed Description

Definition at line 28 of file Weather.cs.

Member Function Documentation

◆ Add()

void Weather.WeatherForecast.Add ( Condition  con,
int  h 
)
inline

Definition at line 34 of file Weather.cs.

35 {
36 if (cons.ContainsKey(con))
37 {
38 cons[con] += h;
39 }
40 else
41 {
42 cons[con] = h;
43 }
44 }
Dictionary< Condition, int > cons
Definition: Weather.cs:32

References Weather.WeatherForecast.cons.

Referenced by Weather.GetWeatherForecast().

◆ Finish()

void Weather.WeatherForecast.Finish ( )
inline

Definition at line 46 of file Weather.cs.

47 {
48 if (cons.Count == 0)
49 {
50 return;
51 }
52 int num = cons.Sum((KeyValuePair<Condition, int> c) => c.Value);
53 if (num == 0)
54 {
55 return;
56 }
57 foreach (Condition item in cons.Keys.ToList())
58 {
59 cons[item] = cons[item] * 100 / num;
60 }
61 }

References Weather.WeatherForecast.cons, and item.

Referenced by Weather.GetWeatherForecast().

Member Data Documentation

◆ cons

Dictionary<Condition, int> Weather.WeatherForecast.cons = new Dictionary<Condition, int>()

Definition at line 32 of file Weather.cs.

Referenced by Weather.WeatherForecast.Add(), and Weather.WeatherForecast.Finish().

◆ date

Date Weather.WeatherForecast.date

Definition at line 30 of file Weather.cs.

Referenced by Weather.GetWeatherForecast().


The documentation for this class was generated from the following file: