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); }
public MobManager(EntityManager manager) { EntityManager = manager; SpawnRules = new Dictionary<Dimension, List<ISpawnRule>>(); }
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)); }
public void AddWorld(IWorld world) { Worlds.Add(world); world.BlockRepository = BlockRepository; world.BlockChanged += HandleBlockChanged; var manager = new EntityManager(this, world); EntityManagers.Add(manager); }