using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace KonKopiujący { class Mp3 { public bool stan; public bool battery; public int songs; public int memory; public int elektrycity; public Mp3() { stan = false; battery = true; songs = 666; memory = 1024; elektrycity = 0; } public int WSongs { get { return songs; } set { songs = value; } } public int WMemory { get { return memory; } set { memory = value; } } public void Start() { if (stan) { stan = false; elektrycity = 0; } else { stan = true; elektrycity = 20; } } public void Check() { if (stan && battery) { Console.WriteLine("Urzadzenie jest wlaczone!"); } else { Console.WriteLine("Urzadzenie jest wylaczone!"); } if (battery) { Console.WriteLine("Baterie sa wlozone!"); } else { Console.WriteLine("Brak bateri!"); } Console.WriteLine("W pamieci jest: " + songs); Console.WriteLine("Pamiec wynosi: " + memory); } public int WElektrycity { set { elektrycity = value; } } public void Dokup() { Console.WriteLine("Ile losowych piosenek chcesz dokupić?"); int x = 0; x = int.Parse(Console.ReadLine()); Console.WriteLine("Dokupiono " + x + " nowych piosenek! Miłego słuchania!"); songs = songs + x; } public Mp3(Mp3 x) { this.stan = x.stan; this.battery = x.battery; this.songs = x.songs; this.memory = x.memory; } private void Boost() { memory += 2048; } public static Mp3 operator +(Mp3 lx, Mp3 rx) { Mp3 C = new Mp3(); C.songs = lx.songs + rx.songs; C.memory = lx.memory + rx.memory; return C; } public static bool operator <(Mp3 lx, Mp3 rx) { return (lx.elektrycity < rx.elektrycity); } public static bool operator >(Mp3 lx, Mp3 rx) { return (lx.elektrycity > rx.elektrycity); } } }