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