Esempio n. 1
0
        /// <summary>
        /// Creates a new world.
        /// </summary>
        /// <param name="name">The name of the folder to contain and identify the world.</param>
        /// <returns>The newly created world.</returns>
        internal WorldManager CreateWorld(string name)
        {

            WorldManager world = new WorldManager(this);

            //Event
            WorldCreatedEventArgs e = new WorldCreatedEventArgs(world);
            PluginManager.CallEvent(Event.WorldCreate, e);
            if (e.EventCanceled) return null;
            //End Event

            lock (Worlds)
                Worlds.Add(world);

            return world;
        }
Esempio n. 2
0
 private void OnWorldCreated(WorldCreatedEventArgs e)
 {
     foreach (EventListener bl in Plugins)
     {
         IWorldListener ll = (IWorldListener)bl.Listener;
         if (bl.Event == Event.WorldCreate)
             ll.OnWorldCreated(e);
     }
 }