예제 #1
0
    public List <int[]> get_parking_spot_with_room()
    {
        List <int[]> room_availability_list           = new List <int[]>();
        List <int[]> room_availability_and_train_list = new List <int[]>(); //takes priority because it has train

        foreach (KeyValuePair <string, GameObject> entry in building_map)
        {
            // do something with entry.Value or entry.Key
            BuildingLot bldg_lot = entry.Value.GetComponent <BuildingLot>();
            if (bldg_lot.building.current_capacity > 0)
            {
                if (bldg_lot.does_station_have_train())
                {
                    room_availability_and_train_list.Add(bldg_lot.parking_coord);
                }
                else
                {
                    room_availability_list.Add(bldg_lot.parking_coord);
                }
            }
        }
        room_availability_and_train_list.AddRange(room_availability_list);
        return(room_availability_and_train_list);
    }