コード例 #1
0
 /// <summary>
 /// Checks if the given user is part of this campaign, either as a user or dungeon master
 /// </summary>
 /// <param name="user">User to look for</param>
 /// <returns>Whether or not the user is in the campaign</returns>
 public bool IsUserInCampaign(User user)
 {
     if (CampaignUsers is null)
     {
         return(false);
     }
     if (!(DungeonMaster is null) && DungeonMaster.Equals(user))
     {
         return(true);
     }
     foreach (User campaignUser in CampaignUsers)
     {
         if (campaignUser.Equals(user))
         {
             return(true);
         }
     }
     return(false);
 }