Files
basic-computer-games/83_Stock_Market/csharp/src/TradingDay.cs
Chris Reuter d26dbf036a Removed spaces from top-level directory names.
Spaces tend to cause annoyances in a Unix-style shell environment.
This change fixes that.
2021-11-21 18:30:21 -05:00

25 lines
653 B
C#

using System.Collections.Immutable;
using System.Linq;
namespace Game
{
/// <summary>
/// Represents a single trading day.
/// </summary>
public record TradingDay
{
/// <summary>
/// Gets the average share price of all companies in the market this
/// day.
/// </summary>
public double AverageSharePrice =>
Companies.Average (company => company.SharePrice);
/// <summary>
/// Gets the collection of public listed companies in the stock market
/// this day.
/// </summary>
public ImmutableArray<Company> Companies { get; init; }
}
}