AI Help

Guys, I want to make a pizza restaurant. Customers will come and sit I will give them pizza. I want to make the same quantity customer with the same table quantity. How Can I check like the table has already been taken then set the destination to another also I want to add expansion to the restaurant? How can I handle these AI s? I want something like Fashion Universe in Playstore. Thanks

To handle if a table has been taken you could have two arrays: One the destination points for the tables (destination point for table1, for table2…) and another one of booleans to check if the table has been taken. When a customer sits on a table the boolean of the array that corresponds to that table is set to true, and when he leaves is set to false.
The AI will loop through all the boolenas untill it finds one that is true and then go to the position of the corresponding table.
Some code:

public NavMeshAgent agent;

public bool[] areTablesTaken;
public Vector3[] tablesPositions;

//Call it when you need to the agent to go to a table
void GivePizza()
{
    for(int i = 0; i < areTablesTaken; i++) //Loop for all the tables
    {
        if(areTablesTaken[i]) //Is the table taken?
        {
            agent.SetDestination(tablesPosition[i]); //Go to the table
            return; //We have a table, no need of checking the others
        }
    }
}

//Call this to change the tables state
public void ChangeTableState(int id)
{
    areTablesTaken[i] = !areTablesTaken[i]; //If it was taken we set to not taken and vice versa
}

The code needs to be adjusted, but that is the basic idea.
Also, I wrote this on the fly, maby it has errors.