commit1
This commit is contained in:
60
gyakorlasdogara0920/Podcast.cs
Normal file
60
gyakorlasdogara0920/Podcast.cs
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user