示例#1
0
 public void AddWorld(IWorld world)
 {
     Worlds.Add(world);
     world.BlockRepository = BlockRepository;
     world.ChunkGenerated += HandleChunkGenerated;
     world.BlockChanged += HandleBlockChanged;
     var manager = new EntityManager(this, world);
     EntityManagers.Add(manager);
     var lighter = new WorldLighting(world, BlockRepository);
     WorldLighters.Add(lighter);
 }
示例#2
0
 public MobManager(EntityManager manager)
 {
     EntityManager = manager;
     SpawnRules = new Dictionary<Dimension, List<ISpawnRule>>();
 }
示例#3
0
 public void AddWorld(IWorld world)
 {
     Worlds.Add(world);
     world.BlockRepository = BlockRepository;
     world.ChunkGenerated += HandleChunkGenerated;
     world.ChunkLoaded += HandleChunkLoaded;
     world.BlockChanged += HandleBlockChanged;
     var manager = new EntityManager(this, world);
     EntityManagers.Add(manager);
     var lighter = new WorldLighting(world, BlockRepository);
     WorldLighters.Add(lighter);
     foreach (var chunk in world)
         HandleChunkLoaded(world, new ChunkLoadedEventArgs(chunk));
 }
示例#4
0
 public void AddWorld(IWorld world)
 {
     Worlds.Add(world);
     world.BlockRepository = BlockRepository;
     world.BlockChanged += HandleBlockChanged;
     var manager = new EntityManager(this, world);
     EntityManagers.Add(manager);
 }