What the best way to go about creating a social class

Im trying to make a game where one aspect is my citizens (NPCs) will be taxed as a source of income for the city , the way I decided to go about it was to create a function that calculates their gross income and then use this to number to put them into a certain “class” I.e. poor, and middle. I used a Array containing the different classes

To sum up my question, Whats the best way to go about this, using list, enum, array, or dictionaries? How do you make an if statement based on a number being in a certain range?

Here’s the code I commented out a lot of the unused variables:

 using UnityEngine;
    using System.Collections;
    using System.Collections.Generic;
   
   
    public class Class_System : MonoBehaviour
    {
   
        //public float income;
        //public string job;
   
     
        string[] finClassArray = {"Poor", "Middle Class", "Elite"};
        public int myHourly;
        private int myMonthly;
        public  int myGross;
   
   
   
        void Start ()
        {
   
            _monthlyIncome ();
            _grossIncome();
   
            if ((Mathf.Clamp (myGross, 0, 4999))  {
                Debug.Log ("We made it");
            }
   
        }
   
   
        void Update ()
        {
   
        }
   
        public int _monthlyIncome()      //calculate Monthly Income
        {
            myMonthly = myHourly * 31;
            //myGross = myMonthly * 12;
           
            Debug.Log(gameObject.name);
            Debug.Log("Makes");
            Debug.Log (myMonthly);
           
            return myMonthly;
        }
       
        public int _grossIncome()                     //calculates Gross income
        {
            myGross = myMonthly * 12;
           
            Debug.Log (myGross);
           
            return(myGross);
        }
    }

I would have a class that manages the classes. ClassManager, then have it so you can pass in a value, in this case the income, and have it return an enum that represents the type of class they are.

public class ClassManager : System.Object {

public enum ClassType {
Poor,
MiddleClass,
UpperClass
}
public static ClassType GetClassType(int income) {
// if statement here
return ClassType;
}
}

Sorry, typed this on mobile. If you do a google search you can find the income ranges on how the government ranks households based on income. Hope this helps.

Yes it does thank you, also (if willing). Can you tell me how to access a variable from another script with out making it static.

I used the http://docs.unity3d.com/412/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html
I get an error saying "cannot explicitly convert… "

Class_System class_system = GetComponents<Class_System> ();

The idea is that I access the “myGross” variable in order to make a function to calculate how much each NPC is taxed

//Maybe somthing like

void Start ()
{
taxation();
}

public float taxation()
{
mygross * .07f  ;
}

Well it depends on how you want to go about things. What will be the purpose? I know you said the taxation but for what reason? Depending on the answer will spark the most optimal way of doing things. (Singleton might be the way to go so far).

Well the game i’m trying to make is a gonna be like a village management simulator. The taxation will be one of the major sources of income for the village I’m managing along side trade and some other things.

sorry it took so long to reply, I hope that the answer you where looking for