bool Get(IChunkCache cache, int i) { var content = new byte[1024]; PackUnpack.PackInt32BE(content, 0, i); return(cache.Get(CalcHash(content)).Result.Length == 1024); }
public override void Initialize() { this._player = (IPlayer)this.Game.Services.GetService(typeof(IPlayer)); this._world = (IWorld)this.Game.Services.GetService(typeof(IWorld)); this._chunkCache = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache)); this._blockStorage = (IBlockStorage)this.Game.Services.GetService(typeof(IBlockStorage)); }
void Put(IChunkCache cache, int i) { var content = new byte[1024]; PackUnpack.PackInt32BE(content, 0, i); cache.Put(CalcHash(content), ByteBuffer.NewAsync(content)); }
public override void Initialize() { this._player = (IPlayer) this.Game.Services.GetService(typeof (IPlayer)); this._world = (IWorld) this.Game.Services.GetService(typeof (IWorld)); this._chunkCache = (IChunkCache) this.Game.Services.GetService(typeof (IChunkCache)); this._blockStorage = (IBlockStorage) this.Game.Services.GetService(typeof (IBlockStorage)); }
public override void Initialize() { Logger.Trace("init()"); // import required services. this._chunkCache = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache)); // init the block array. Blocks = new Block[CacheWidthInBlocks * CacheLenghtInBlocks * Chunk.HeightInBlocks]; }
/// <summary> /// Initializes the statistics service. /// </summary> public override void Initialize() { Logger.Trace("init()"); // import required services. this._player = (IPlayer)this.Game.Services.GetService(typeof(IPlayer)); this._fogger = (IFogger)this.Game.Services.GetService(typeof(IFogger)); this._world = (IWorld)this.Game.Services.GetService(typeof(IWorld)); this._chunkStorage = (IChunkStorage)this.Game.Services.GetService(typeof(IChunkStorage)); this._chunkCache = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache)); base.Initialize(); }
public override void Initialize() { Logger.Trace("init()"); this.FlyingEnabled = true; this.Weapon = new Shovel(Game); this.LoadContent(); // import required services. this._camera = (ICamera)this.Game.Services.GetService(typeof(ICamera)); this._chunkCache = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache)); this.Weapon.Initialize(); }
/// <summary> /// Initializes the debug-bar service. /// </summary> public override void Initialize() { Logger.Trace("init()"); // import required services. this._player = (IPlayer)this.Game.Services.GetService(typeof(IPlayer)); this._fogger = (IFogger)this.Game.Services.GetService(typeof(IFogger)); this._world = (IWorld)this.Game.Services.GetService(typeof(IWorld)); this._chunkStorage = (IChunkStorage)this.Game.Services.GetService(typeof(IChunkStorage)); this._chunkCache = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache)); this._assetManager = (IAssetManager)this.Game.Services.GetService(typeof(IAssetManager)); if (this._assetManager == null) { throw new NullReferenceException("Can not find asset manager component."); } base.Initialize(); }
/// <summary> /// Initializes the input manager. /// </summary> public override void Initialize() { Logger.Trace("init()"); // import required services. this._world = (IWorld)this.Game.Services.GetService(typeof(IWorld)); this._player = (IPlayer)this.Game.Services.GetService(typeof(IPlayer)); this._graphicsManager = (IGraphicsManager)this.Game.Services.GetService(typeof(IGraphicsManager)); this._cameraController = (ICameraControlService)this.Game.Services.GetService(typeof(ICameraControlService)); this._ingameDebuggerService = (IInGameDebuggerService)this.Game.Services.GetService(typeof(IInGameDebuggerService)); this._fogger = (IFogger)this.Game.Services.GetService(typeof(IFogger)); this._skyService = (ISkyService)this.Game.Services.GetService(typeof(ISkyService)); this._chunkCache = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache)); this._bloomService = (IBloomService)this.Game.Services.GetService(typeof(IBloomService)); // get current mouse & keyboard states. this._previousKeyboardState = Keyboard.GetState(); this._previousMouseState = Mouse.GetState(); base.Initialize(); }
public override void Initialize() { Logger.Trace("init()"); this.FlyingEnabled = true; this.Weapon = new Shovel(Game); // import required services. this._camera = (ICamera)this.Game.Services.GetService(typeof(ICamera)); this._chunkCache = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache)); this._blockStorage = (IBlockStorage)this.Game.Services.GetService(typeof(IBlockStorage)); this._assetManager = (IAssetManager)this.Game.Services.GetService(typeof(IAssetManager)); if (this._assetManager == null) { throw new NullReferenceException("Can not find asset manager component."); } this.LoadContent(); this.Weapon.Initialize(); }
public PlanetResourceManager(IChunkCache chunkCache) { _chunkCache = chunkCache; }
/// <summary> /// Initializes the input manager. /// </summary> public override void Initialize() { Logger.Trace("init()"); // import required services. this._world = (IWorld) this.Game.Services.GetService(typeof (IWorld)); this._player = (IPlayer) this.Game.Services.GetService(typeof (IPlayer)); this._graphicsManager = (IGraphicsManager) this.Game.Services.GetService(typeof (IGraphicsManager)); this._cameraController = (ICameraControlService) this.Game.Services.GetService(typeof (ICameraControlService)); this._ingameDebuggerService =(IInGameDebuggerService) this.Game.Services.GetService(typeof (IInGameDebuggerService)); this._fogger = (IFogger) this.Game.Services.GetService(typeof (IFogger)); this._skyService = (ISkyService) this.Game.Services.GetService(typeof (ISkyService)); this._chunkCache = (IChunkCache) this.Game.Services.GetService(typeof (IChunkCache)); this._bloomService = (IBloomService) this.Game.Services.GetService(typeof (IBloomService)); // get current mouse & keyboard states. this._previousKeyboardState = Keyboard.GetState(); this._previousMouseState = Mouse.GetState(); base.Initialize(); }
public override void Initialize() { Logger.Trace("init()"); this.FlyingEnabled = true; this.Weapon = new Shovel(Game); this.LoadContent(); // import required services. this._camera = (ICamera) this.Game.Services.GetService(typeof (ICamera)); this._chunkCache = (IChunkCache) this.Game.Services.GetService(typeof (IChunkCache)); this.Weapon.Initialize(); }
/// <summary> /// Initializes the debug-bar service. /// </summary> public override void Initialize() { Logger.Trace("init()"); // import required services. this._player = (IPlayer)this.Game.Services.GetService(typeof(IPlayer)); this._fogger = (IFogger)this.Game.Services.GetService(typeof(IFogger)); this._world = (IWorld)this.Game.Services.GetService(typeof(IWorld)); this._chunkStorage = (IChunkStorage)this.Game.Services.GetService(typeof(IChunkStorage)); this._chunkCache = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache)); this._assetManager = (IAssetManager)this.Game.Services.GetService(typeof(IAssetManager)); if (this._assetManager == null) throw new NullReferenceException("Can not find asset manager component."); base.Initialize(); }
/// <summary> /// Initializes the statistics service. /// </summary> public override void Initialize() { Logger.Trace("init()"); // import required services. this._player = (IPlayer) this.Game.Services.GetService(typeof (IPlayer)); this._fogger = (IFogger) this.Game.Services.GetService(typeof (IFogger)); this._world = (IWorld) this.Game.Services.GetService(typeof (IWorld)); this._chunkStorage = (IChunkStorage) this.Game.Services.GetService(typeof (IChunkStorage)); this._chunkCache = (IChunkCache) this.Game.Services.GetService(typeof (IChunkCache)); base.Initialize(); }
public ChunkLoader(IChunkCache cache, int range, Index3 center) { _center = center; _maxRange = range; _cache = cache; }
public override void Initialize() { // import required services. this._chunkCache = (IChunkCache)this.Game.Services.GetService(typeof(IChunkCache)); }
bool Get(IChunkCache cache, int i) { var content = new byte[1024]; PackUnpack.PackInt32BE(content, 0, i); return cache.Get(CalcHash(content)).Result.Length == 1024; }
public override void Initialize() { // import required services. this._chunkCache = (IChunkCache) this.Game.Services.GetService(typeof (IChunkCache)); }
public override void Initialize() { Logger.Trace("init()"); this.FlyingEnabled = true; this.Weapon = new Shovel(Game); // import required services. this._camera = (ICamera) this.Game.Services.GetService(typeof (ICamera)); this._chunkCache = (IChunkCache) this.Game.Services.GetService(typeof (IChunkCache)); this._blockStorage = (IBlockStorage) this.Game.Services.GetService(typeof (IBlockStorage)); this._assetManager = (IAssetManager)this.Game.Services.GetService(typeof(IAssetManager)); if (this._assetManager == null) throw new NullReferenceException("Can not find asset manager component."); this.LoadContent(); this.Weapon.Initialize(); }