Beispiel #1
0
        /// <summary>
        /// Determines whether the building with the specified ID is a shopping target.
        /// </summary>
        /// <param name="buildingId">The building ID to check.</param>
        /// <returns>
        ///   <c>true</c> if the building is a shopping target; otherwise, <c>false</c>.
        /// </returns>
        public bool IsShoppingTarget(ushort buildingId)
        {
            if (buildingId == 0)
            {
                return(true);
            }

            // A building still can post outgoing offers while inactive.
            // This is to prevent those offers from being dispatched.
            if (!buildingManager.BuildingHasFlags(buildingId, Building.Flags.Active))
            {
                return(false);
            }

            var buildingService = buildingManager.GetBuildingService(buildingId);

            if (buildingService == ItemClass.Service.VarsitySports)
            {
                return(false);
            }
            else if (buildingService == ItemClass.Service.Monument)
            {
                return(buildingManager.IsRealUniqueBuilding(buildingId));
            }
            else
            {
                return(true);
            }
        }