/// <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); }
/// <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); } }
private void MainWorld_WorldGenerated(object sender, MagicalLifeAPI.World.WorldEventArgs e) { ServerSendRecieve.SendAll <WorldTransferMessage>(new WorldTransferMessage(e.World)); }