This commit is contained in:
Reményi Zétény
2025-09-20 19:25:22 +02:00
commit 4894d702e1
58 changed files with 727 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using gyakorlasdogara0920;
namespace gyakorlasdogara0920
{
internal class Podcastok : Zenek
{
public Dictionary<int, string> Fejezetek { get; set; }
public string Leiras { get; set; }
private bool feliratkozas;
public bool Feliratkozas
{
get { return feliratkozas; }
}
public Podcastok(string cim, string eloado, int kiadasEve, int hossz, int minoseg, Dictionary<int, string> fejezetek, string leiras, bool feliratkozas)
: base(cim, eloado, kiadasEve, hossz, minoseg)
{
Fejezetek = fejezetek;
Leiras = leiras;
this.feliratkozas = feliratkozas;
}
public string feliratkoz()
{
this.feliratkozas = true;
return $"A {Cim} podcastre fel lettél iratkozva!";
}
public string leiratkoz()
{
this.feliratkozas = false;
return $"A {Cim} podcastről leiratkoztál!";
}
public string fejezetKezdopontMeghataroz()
{
int elozoElem = 0;
string fejezetKezdesek = "";
int reszHossz = 0;
foreach (var elem in Fejezetek)
{
fejezetKezdesek += $"{elem.Value}: " + reszHossz + $". perctől; ";
reszHossz += elem.Key;
}
return fejezetKezdesek;
}
}
}