예제 #1
0
 public void LoadBlocks(IChunkLoader loader)
 {
     _world.RWLock.AcquireWriterLock(System.Threading.Timeout.Infinite);
     loader.LoadChunk(_key, _data);
     _world.RWLock.ReleaseWriterLock();
     _world.ChunkModified(this);
 }
예제 #2
0
        /// <summary> Default constructor. </summary>
        /// <param name="loader"> A factory which can load and save the chunks as needed. </param>
        public World(IChunkLoader loader)
        {
            _loader = loader;
            Chunks  = new Chunk[NumberOfChunksWide * NumberOfChunksWide];

            LoadChunks();
        }
예제 #3
0
        protected override IChunkProvider func_22086_b()
        {
            IChunkLoader ichunkloader = worldFile.func_22092_a(worldProvider);

            field_20911_y = new ChunkProviderServer(this, ichunkloader, worldProvider.getChunkProvider());
            return(field_20911_y);
        }
예제 #4
0
        protected void RegisterChunkEvents(IChunkLoader item)
        {
            item.OnChunkLoad         += ChunksLoaded;
            item.OnChunksGenerated   += ChunksGenerated;
            item.OnChunksUnavailable += ChunksUnavailable;

            ChunkProviders.Add(item);
        }
예제 #5
0
 public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider)
 {
     field_725_a = new HashSet();
     id2ChunkMap = new HashMap();
     field_727_f = new ArrayList();
     field_724_b = new EmptyChunk(worldserver, new byte[32768], 0, 0);
     world = worldserver;
     field_729_d = ichunkloader;
     field_730_c = ichunkprovider;
 }
예제 #6
0
 public ChunkProviderLoadOrGenerate(World world, IChunkLoader ichunkloader, IChunkProvider ichunkprovider)
 {
     chunks = new Chunk[1024];
     lastQueriedChunkXPos = unchecked((int) 0xc4653601);
     lastQueriedChunkZPos = unchecked((int) 0xc4653601);
     blankChunk = new EmptyChunk(world, new byte[32768], 0, 0);
     worldObj = world;
     chunkLoader = ichunkloader;
     chunkProvider = ichunkprovider;
 }
예제 #7
0
 public ChunkProvider(World par1World, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider)
 {
     droppedChunksSet = new List <long>();
     chunkMap         = new LongHashMap();
     chunkList        = new List <Chunk>();
     emptyChunk       = new EmptyChunk(par1World, 0, 0);
     worldObj         = par1World;
     chunkLoader      = par2IChunkLoader;
     chunkProvider    = par3IChunkProvider;
 }
예제 #8
0
 public ChunkProviderLoadOrGenerate(World world, IChunkLoader ichunkloader, IChunkProvider ichunkprovider)
 {
     chunks = new Chunk[1024];
     lastQueriedChunkXPos = unchecked ((int)0xc4653601);
     lastQueriedChunkZPos = unchecked ((int)0xc4653601);
     blankChunk           = new EmptyChunk(world, new byte[32768], 0, 0);
     worldObj             = world;
     chunkLoader          = ichunkloader;
     chunkProvider        = ichunkprovider;
 }
예제 #9
0
 public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, IChunkProvider ichunkprovider)
 {
     field_725_a = new HashSet();
     id2ChunkMap = new HashMap();
     field_727_f = new ArrayList();
     field_724_b = new EmptyChunk(worldserver, new byte[32768], 0, 0);
     world       = worldserver;
     field_729_d = ichunkloader;
     field_730_c = ichunkprovider;
 }
예제 #10
0
        public ActorHost(Player player, IChunkLoader chunkLoader)
        {
            _chunkLoader = chunkLoader;

            Player = player;
            planet = ResourceManager.Instance.GetPlanet(Player.Position.Planet);

            _oldIndex = Player.Position.ChunkIndex;

            ActiveTool = null;
            State      = WorldState.Loading;
        }
예제 #11
0
        public ActorHost(Player player, IChunkLoader chunkLoader)
        {
            _chunkLoader = chunkLoader;

            Player = player;
            planet = ResourceManager.Instance.GetPlanet(Player.Position.Planet);

            _oldIndex = Player.Position.ChunkIndex;

            ActiveTool = null;
            State = WorldState.Loading;
        }
예제 #12
0
 public ChunkProvider(
     ILogger logger,
     ChunkProviderOptions chunkProviderOptions,
     IChunkLoader chunkLoader,
     IChunkSaver chunkSaver,
     IChunkCreator chunkCreator)
 {
     _logger = logger.ForContext <ChunkProvider>();
     _chunkProviderOptions = chunkProviderOptions;
     _chunkLoader          = chunkLoader;
     _chunkSaver           = chunkSaver;
     _chunkCreator         = chunkCreator;
     _chunks = new Dictionary <Vector2i, Chunk>(8192);
 }
예제 #13
0
    public Chunk CreateChunk(Vector3i key, IChunkLoader loader = null)
    {
        // TODO check that chunk doesn't exist yet
        // TODO check that chunk is within given size bounds
        var chunk = new Chunk(key, this);

        _chunks.Add(chunk.Key, chunk);

        if (loader != null)
        {
            BeginBatchUpdate();
            chunk.LoadBlocks(loader);
            EndBatchUpdate();
        }

        return(chunk);
    }
예제 #14
0
 public void AddChunkLoader(IChunkLoader chunkLoader)
 {
     RegisterChunkEvents(chunkLoader);
 }
 public ChunkCache(IChunkLoader loader)
 {
     _chunkLoader = loader;
 }
예제 #16
0
 public TemplateComposer(TypePool types, IChunkLoader chunkLoader)
 {
     _types       = types;
     _chunkLoader = chunkLoader;
 }
예제 #17
0
파일: Template.cs 프로젝트: jemacom/fubumvc
 public Parsings(IChunkLoader chunkLoader)
 {
     _chunkLoader = chunkLoader;
 }
예제 #18
0
 public TemplateComposer(ITemplateRegistry templateRegistry, IChunkLoader chunkLoader)
 {
     _templateRegistry = templateRegistry;
     _chunkLoader      = chunkLoader;
 }
예제 #19
0
        void Awake()
        {
            // If no instance has been set when this object awakened
            if (_instance == null)
            {
                _instance = this;
            }else{
                Debug.LogWarning("An object with ZapLoader has been instantiated but an instance has been created already. The component will be removed from this object");
                Destroy (this);
            }

            // Creates an instance of the ChunkLoader
            try
            {
                chunkLoader = (IChunkLoader)gameObject.AddComponent(chunkLoadingPlugin);
            }catch{
                Debug.LogError("An error occured while loading the chunk plugin.");
            }
        }
예제 #20
0
 public Parsings(IChunkLoader chunkLoader)
 {
     _chunkLoader = chunkLoader;
 }