Beispiel #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="name"></param>
 /// <param name="parent"></param>
 /// <param name="strategy"></param>
 public PagedWorldSection(string name, PageWorld parent, PageStrategy strategy,
     SceneManager sm)
 {
     mName = name;
     mParent = parent;
     Strategy = strategy;
     mSceneMgr = sm;
 }
Beispiel #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="stream"></param>
 /// <param name="name"></param>
 public void SaveWorld(PageWorld world, Stream stream)
 {
     world.Save(stream);
 }
Beispiel #3
0
 /// <summary>
 /// Construct a new instance, specifying just the parent (expecting to load). 
 /// </summary>
 /// <param name="parent"></param>
 public PagedWorldSection(PageWorld parent)
 {
     mParent = parent;
 }
Beispiel #4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="stream"></param>
 public void SaveWorld(PageWorld world, string fileName)
 {
     world.Save(fileName);
 }
Beispiel #5
0
        /// <summary>
        /// Detach a PagedWorld instance from this manager (note: the caller then
		///	becomes responsible for the correct destruction of this instance)
        /// </summary>
        /// <param name="world"></param>
        public void DetachWorld(PageWorld world)
        {
            mWorlds.Remove(world.Name);
        }
Beispiel #6
0
        /// <summary>
        /// Attach a pre-created PagedWorld instance to this manager. 
        /// </summary>
        /// <param name="world"></param>
        public void AttachWorld(PageWorld world)
        {
            if (mWorlds.ContainsKey(world.Name))
            {
                throw new Exception("World named '" + world.Name + "' allready exists!" +
                    "PageManager.AttachWorld");
            }

            mWorlds.Add(world.Name, world);
        }
Beispiel #7
0
 /// <summary>
 /// Destroy a world.
 /// </summary>
 /// <param name="world"></param>
 public void DestroyWorld(PageWorld world)
 {
     mWorlds.Remove(world.Name);
     world = null;
 }
Beispiel #8
0
        /// <summary>
        /// Create a new PagedWorld instance. 
        /// </summary>
        /// <param name="name">name Optionally give a name to the world (if no name is given, one
		///	will be generated).</param>
        /// <returns></returns>
        public PageWorld CreateWorld(string name)
        {
            string theName = name;
            if (theName == string.Empty)
            {
                do
                {
                    theName = mWorldNameGenerator.GetNextUniqueName();
                }
                while (!mWorlds.ContainsKey(theName));
            }
            else if (mWorlds.ContainsKey(theName))
            {
                throw new Exception("World named '" + theName + "' allready exists!" +
                    "PageManager.CreateWorld");
            }

            PageWorld ret = new PageWorld(theName, this);
            mWorlds.Add(theName, ret);
            return ret;
        }