本文整理匯總了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);
}