public ContentNode Get(int id) { if (_gen < 0) { throw new ObjectDisposedException("snapshot" /*+ " (" + _thisCount + ")"*/); } return(_store.Get(id, _gen)); }
public override void Draw(SpriteBatch spriteBatch) { Game.GraphicsDevice.Clear(Color.Black); // Game spriteBatch.Begin(transformMatrix: Camera.TransformationMatrix); var cryptBoundsToDraw = CryptBoundsToDraw(); var crypt = Game.Gameplay.Crypt; for (int row = cryptBoundsToDraw.Y; row < cryptBoundsToDraw.Height; row++) { for (int col = cryptBoundsToDraw.X; col < cryptBoundsToDraw.Width; col++) { var feature = crypt[new Simulation.Crypt.Coords(row, col)]; feature.Draw(spriteBatch, new Vector2(col * TileUnit, row * TileUnit) + WorldOffset); } } _selectTexture = _selectTexture ?? ContentStore.Get <Texture2D>("Sprites/PlayerSelect"); //var selectPosition = Game.Gameplay.Player.CryptSelectCoords.WorldCoord - new Vector2(SelectTileOffset, SelectTileOffset); spriteBatch.Draw(_selectTexture, _selectPosition, Color.White); spriteBatch.End(); // Hud spriteBatch.Begin(); spriteBatch.End(); }
/// <summary> /// Gets a content entity if exists, otherwise returns default content entity. /// </summary> /// <param name="entityId">Entity identifier.</param> /// <param name="recordId">Entity record identifier.</param> /// <returns>Multilanguage content entity.</returns> public virtual Entity GetContent(Guid entityId, Guid recordId) { foreach (var languageId in LanguageIterator.GetLanguages(recordId)) { var contentEntity = ContentStore.Get(entityId, languageId); if (contentEntity != null) { return(contentEntity); } } return(ContentStore.GetDefault(entityId)); }
public virtual void Draw(SpriteBatch spriteBatch, Vector2 position) { if (_textureKey == null) { return; } if (_texture == null) { _texture = ContentStore.Get <Texture2D>(_textureKey); } spriteBatch.Draw(_texture, position, Color.White); }
public override void Initialize() { this._title = ContentStore.Get <Texture2D>("Sprites/title"); }