C# Reading one or more integer values and assigning an object certain enum attributes based on the integers read
<p>I am having a small problem, and I cant seem to find an answer anywhere. I will try to keep it short and clear</p>

<p>I have a class called exercises, which has an enum responsible for what body parts the exercise hits. Lets say we have </p>

<pre><code>Chest = 1
Shoulders = 2
Arms = 4
Legs = 8
Back = 16
</code></pre>

<p>So far my class "exercise" has a name, and this enum. In theory, this should result in having something like "Bech press - chest, arms n/ Deadlift - back, legs" and so on.</p>

<p>Next I have a class Catalog, that holds all the exercises, and in that class a method, called AddExercise. Here is the code snippet:</p>

<pre><code>    public void AddExercise()
    {
        Exercise ToAdd = new Exercise();
        Console.WriteLine("What is the name of the exercise?");
        string name = Console.ReadLine();
        ToAdd.name = name;
        katalog.Add(ToAdd);
    }
</code></pre>

<p>What I want to do know, is include "What muscle groups does the exercise hit?", and then a multichoice with mentioned muscle groups. My idea is that it would look something like this:</p>

<pre><code>1. Chest
2. Shoulders
3. Arms
4. Legs
5. Back
6. That is all
</code></pre>

<p><strong>As long as the person kept choosing 1-5 the exercise would acquire the enum attributes, and then quit the loop once the person chose 6, but I have no idea how to do this part. From most Ive seen about enums they are mostly used in the string format and parsing, so I have no idea how to assign attributes by reading integer. And the hardest part is assigning several of them.</strong></p>

<p>Here is my enum, by the way:</p>

<pre><code>[Flags]
public enum BodyParts : int
{
    None = 0,
    Chest = 1,
    Shoulders = 2,
    Biceps = 4,
    Triceps = 8,
    Back = 16,
    Legs = 32
}
</code></pre>

<p>Thank you for your answers.</p>