Ejemplo n.º 1
0
        private void AutoloadModWorld(Type type)
        {
            ModWorld modWorld = (ModWorld)Activator.CreateInstance(type);

            modWorld.mod = this;
            string name = type.Name;

            if (modWorld.Autoload(ref name))
            {
                AddModWorld(name, modWorld);
            }
        }
Ejemplo n.º 2
0
 private static bool SendCustomData(ModWorld modWorld, BinaryWriter writer)
 {
     byte[] data;
     using (MemoryStream stream = new MemoryStream())
     {
         using (BinaryWriter customWriter = new BinaryWriter(stream))
         {
             modWorld.SendCustomData(customWriter);
             customWriter.Flush();
             data = stream.ToArray();
         }
     }
     if (data.Length > 0)
     {
         writer.Write(modWorld.mod.Name);
         writer.Write(modWorld.Name);
         writer.Write((ushort)data.Length);
         writer.Write(data);
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
		private static bool SendCustomData(ModWorld modWorld, BinaryWriter writer)
		{
			byte[] data;
			using (MemoryStream stream = new MemoryStream())
			{
				using (BinaryWriter customWriter = new BinaryWriter(stream))
				{
					modWorld.SendCustomData(customWriter);
					customWriter.Flush();
					data = stream.ToArray();
				}
			}
			if (data.Length > 0)
			{
				writer.Write(modWorld.mod.Name);
				writer.Write(modWorld.Name);
				writer.Write((ushort)data.Length);
				writer.Write(data);
				return true;
			}
			return false;
		}
Ejemplo n.º 4
0
 internal static void Add(ModWorld modWorld)
 {
     worlds.Add(modWorld);
 }
Ejemplo n.º 5
0
		internal static void Add(ModWorld modWorld)
		{
			worlds.Add(modWorld);
		}
Ejemplo n.º 6
0
		public void AddModWorld(string name, ModWorld modWorld)
		{
			modWorld.Name = name;
			worlds[name] = modWorld;
			modWorld.mod = this;
			WorldHooks.Add(modWorld);
		}