39 lines
945 B
C#
39 lines
945 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace E_Book
|
|
{
|
|
internal class EBook
|
|
{
|
|
private string? author;
|
|
private string? publishingYear;
|
|
private MediaAssets[] media;
|
|
private decimal totalPageCount;
|
|
|
|
public EBook(int number)
|
|
{
|
|
media = new MediaAssets[number];
|
|
}
|
|
public bool AddMediaAsset(MediaAssets pageCount)
|
|
{
|
|
for (int i = 0; i < media.Length; i++)
|
|
{
|
|
if (media[i] is null)
|
|
{
|
|
media[i] = pageCount;
|
|
totalPageCount += media[i].GetPageCount();
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
public void PrintInof()
|
|
{
|
|
Console.WriteLine($"Das Buch hat {totalPageCount} Seiten,");
|
|
}
|
|
}
|
|
}
|