示例#1
0
        /// <summary>
        /// Generates a new world with the specified height, width, depth, and world generator.
        /// </summary>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="depth"></param>
        /// <param name="generator"></param>
        public static void Initialize(int width, int height, WorldGenerator generator)
        {
            MainWorld       = new World();
            MainWorld.Tiles = MainWorld.GenerateWorld(height, width, generator);

            WorldEventArgs worldEventArgs = new WorldEventArgs(MainWorld);

            World.WorldGeneratedHandler(worldEventArgs);
        }
示例#2
0
        /// <summary>
        /// Raises the world generated event.
        /// </summary>
        /// <param name="e"></param>
        public static void WorldGeneratedHandler(WorldEventArgs e)
        {
            EventHandler <WorldEventArgs> handler = WorldGenerated;

            if (handler != null)
            {
                handler(World.MainWorld, e);
            }
        }
示例#3
0
 private void MainWorld_WorldGenerated(object sender, MagicalLifeAPI.World.WorldEventArgs e)
 {
     ServerSendRecieve.SendAll <WorldTransferMessage>(new WorldTransferMessage(e.World));
 }