Example #1
0
        public GameObject getRandomRoom(RoomPlacementLogic.RoomType roomType)
        {
            List <GameObject> tempTypeList = new List <GameObject>();

            for (int i = 0; i < RoomList.Count; i++)
            {
                if (RoomList[i].GetComponent <RoomPlacementLogic>().roomType == roomType)
                {
                    tempTypeList.Add(RoomList[i]);
                }
            }

            int random = Random.Range(0, tempTypeList.Count);

            return(tempTypeList[random]);

            /*
             * ListWrapper roomGroup = null;
             * for (int i = 0; i < roomSubTypes.Count; i++)
             * {
             *  if (roomSubTypes[i].roomType == roomType)
             *  {
             *      roomGroup = roomSubTypes[i];
             *      break;
             *  }
             * }
             * if (roomGroup != null)
             * {
             *  int choice = Random.Range(0, roomGroup.myList.Count);
             *  return roomGroup.myList[choice];
             * }
             *
             *
             * return null;
             */
        }
Example #2
0
 public GameObject getRandomRoom(RoomPrefabSubTypes roomObject, RoomPlacementLogic.RoomType lookingFor)
 {
     return(roomObject.getRandomRoom(lookingFor));
 }