本文整理汇总了C#中OpenSim.Region.Framework.Scenes.Scene.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.Equals方法的具体用法?C# Scene.Equals怎么用?C# Scene.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.Scene
的用法示例。
在下文中一共展示了Scene.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveScene
public bool RemoveScene(Scene scene)
{
// Remove the given scene from the city map
if (scene.Equals(null))
return (false);
// Firstly check to see if the region is part of one of the central regions.
for (int c = 0; c < centralRegions.Count(); c++)
{
Scene s = centralRegions[c];
if (s.Equals(scene))
{
centralRegions.Remove(s);
break;
}
}
// Now scan the entire map and remove it.
for (int rx = 0; rx < cityRegions.GetUpperBound(0); rx++)
{
for (int ry = 0; rx < cityRegions.GetUpperBound(1); ry++)
{
Scene r = cityRegions[rx, ry];
if (r.Equals(scene))
{
cityRegions[rx, ry] = null;
return (true);
}
}
}
return (false);
}
示例2: AddScene
// SCENE CONTROL.
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);
}