You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
655 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BookApp.Model
{
public class Star
{
public static int MaxStars { get; private set; } = 5;
public int CurrentRating { get; private set; }
public Star(int rating)
{
if (rating < 0 || rating > MaxStars)
throw new ArgumentOutOfRangeException("Rating should be between 0 and MaxStars.");
CurrentRating = rating;
}
public IEnumerable<int> Rating
{
get { return Enumerable.Range(0, MaxStars); }
}
}
}