Aurora.Modules.CityBuilder.CityMap.AddScene C# (CSharp) Method

AddScene() public method

public AddScene ( Scene scene, bool central ) : bool
scene OpenSim.Region.Framework.Scenes.Scene
central bool
return bool
        public bool AddScene(Scene scene, bool central)
        {
            if (scene.Equals(null))
                return (false);

            // do it the hard way and find the first available space.
            if (cityRegions.Equals(null))
                return (false);
            if (cityRegions.GetUpperBound(0) == 0 || cityRegions.GetUpperBound(1) == 0)
            {
                CityModule.m_log.Info("[CITY BUILDER]: No space in city regions!");
                return (false);
            }
            for (int rx = 0; rx < cityRegions.GetUpperBound(0); rx++)
            {
                for (int ry = 0; ry < cityRegions.GetUpperBound(1); ry++)
                {
                    if (cityRegions[rx, ry].Equals(scene))
                        return (true);
                    if (cityRegions[rx, ry].Equals(null))
                    {
                        cityRegions[rx, ry] = scene;
                        if (central)
                            centralRegions.Add(scene);
                        CityModule.m_log.InfoFormat("[CITY BUILDER]: Added new region {0} @ {1},{2}",
                            scene.RegionInfo.RegionName, rx, ry);
                        return (true);
                    }
                }
            }

            return (false);
        }