コード例 #1
0
ファイル: Band.cs プロジェクト: CalebLam14/NebulaPlayer
 public void EditSinger(Singer tempSinger, int singerIndex) // Edit a singer's information, takes in a class object (Singer) & the index of the singer as parameters
 {
     // Updates all the singer's information with the information that the user inputs in
     singers[singerIndex].Name      = tempSinger.Name;
     singers[singerIndex].Gender    = tempSinger.Gender;
     singers[singerIndex].Age       = tempSinger.Age;
     singers[singerIndex].Height    = tempSinger.Height;
     singers[singerIndex].Weight    = tempSinger.Weight;
     singers[singerIndex].Hobbies   = tempSinger.Hobbies;
     singers[singerIndex].SingerPfp = tempSinger.SingerPfp;
 }
コード例 #2
0
ファイル: Band.cs プロジェクト: CalebLam14/NebulaPlayer
 public bool RemoveFavSinger(Singer theSinger) // Remove a singer from the list of favourite singers, takes in a class object (Singer) as parameter
 {
     // singer is in the list of favourite singers, remove it
     if (favSingers.Contains(theSinger))
     {
         favSingers.Remove(theSinger);
         return(true);
     }
     // singer was not in the list of favourite singers
     else
     {
         return(false);
     }
 }
コード例 #3
0
ファイル: Band.cs プロジェクト: CalebLam14/NebulaPlayer
 /*
  * public bool AddSinger(string name, string gender, int age, int height, int weight, string hobbies, Image pfp)
  * {
  *  Singer aSinger = new Singer (name, gender, age, height, weight, hobbies, pfp);
  *  singers.Add(aSinger);
  *
  *  return AddSinger(aSinger);
  * }
  */
 public bool AddSinger(Singer aSinger) // Add a singer into a band, takes in a class object (Singer) as parameter
 {
     // if singer is already in the band, don't add
     if (singers.Contains(aSinger))
     {
         return(false);
     }
     // singer is new, add to this band
     else
     {
         singers.Add(aSinger);
         return(true);
     }
 }
コード例 #4
0
ファイル: Band.cs プロジェクト: CalebLam14/NebulaPlayer
 public bool AddFavSinger(Singer aSinger)  // Add a singer into the list of favourite singers, takes in a class object (Singer) as parameter
 {
     // if singer is already in the list of favourite singers, don't add
     if (favSingers.Contains(aSinger))
     {
         return(false);
     }
     // singer is new, add to the list of favourite singers
     else
     {
         favSingers.Add(aSinger);
         return(true);
     }
 }