Пример #1
0
        /// <summary>
        /// Creates a random bundle for the given room
        /// </summary>
        /// <param name="room">The room to create the bundle for</param>
        /// <param name="roomId">The room id</param>
        /// <returns>The created bundle</returns>
        private static Bundle CreateBundleForRoom(CommunityCenterRooms room, int roomId)
        {
            Bundle bundle = Bundle.Create(room, roomId);

            _randomizedBundles[bundle.Key] = bundle.ToString();
            return(bundle);
        }
        /// <summary>
        /// The factory call for this bundle - creates one of the appropriate type
        /// If there's no bundle types left, will default to a random bundle
        /// Has a 10% chance of generating a random bundle, and a 10% chance of a random reward if not the Joja room
        /// </summary>
        /// <param name="room">The room the bundle is in</param>
        /// <param name="id">The id of the bundle</param>
        public static Bundle Create(CommunityCenterRooms room, int id)
        {
            Bundle createdBundle = null;

            switch (room)
            {
            case CommunityCenterRooms.CraftsRoom:
                createdBundle = new CraftingRoomBundle();
                break;

            case CommunityCenterRooms.Pantry:
                createdBundle = new PantryBundle();
                break;

            case CommunityCenterRooms.FishTank:
                createdBundle = new FishTankBundle();
                break;

            case CommunityCenterRooms.BoilerRoom:
                createdBundle = new BoilerRoomBundle();
                break;

            case CommunityCenterRooms.Vault:
                createdBundle = new VaultBundle();
                break;

            case CommunityCenterRooms.BulletinBoard:
                createdBundle = new BulletinBoardBundle();
                break;

            case CommunityCenterRooms.Joja:
                createdBundle = new JojaBundle();
                break;

            default:
                Globals.ConsoleError($"Cannot create bundle for room: {room.ToString()}");
                return(null);
            }

            createdBundle.Room = room;
            createdBundle.Id   = id;

            if (!createdBundle.TryGenerateRandomBundle())
            {
                createdBundle.Populate();
            }
            if (!createdBundle.TryGenerateRandomReward())
            {
                createdBundle.GenerateReward();
            }

            if (createdBundle.RequiredItems == null || createdBundle.RequiredItems.Count == 0)
            {
                createdBundle.GenerateRandomBundleFailsafe();
            }

            return(createdBundle);
        }
Пример #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="room">The room</param>
 /// <param name="startingIndex">The room ID to start at</param>
 /// <param name="endingIndex">The index to end at</param>
 public RoomInformation(CommunityCenterRooms room, int startingIndex, int endingIndex)
 {
     Room          = room;
     StartingIndex = startingIndex;
     EndingIndex   = endingIndex;
 }