public void Draw(GameTime gameTime, SpriteBatch spriteBatch, Camera camera) { GroundLayer?.Draw(gameTime, spriteBatch, TileSet, camera); EdgeLayer?.Draw(gameTime, spriteBatch, TileSet, camera); BuildingLayer?.Draw(gameTime, spriteBatch, TileSet, camera); DecorationLayer?.Draw(gameTime, spriteBatch, TileSet, camera); }
public void Update(GameTime gameTime) { GroundLayer?.Update(gameTime); EdgeLayer?.Update(gameTime); BuildingLayer?.Update(gameTime); DecorationLayer?.Update(gameTime); }
public Edge AddEdge(uint fromId, uint toId, short label) { if (HasEdge(fromId, toId)) { return(null); } Node from = FindNode(fromId); Node to = FindNode(toId); if ((from == null) || (to == null)) { return(null); } Edge e = new Edge(this, label, from, to); EdgeLayer.Add(e); if (this.BidirectionEdge) { Edge dualE = new Edge(this, label, to, from); EdgeLayer.Add(dualE); e.DualEdge = dualE; dualE.DualEdge = e; } return(e); }
public void FillEdges() { for (int y = 0; y < MapHeight; y++) { for (int x = 0; x < MapWidth; x++) { EdgeLayer.SetTile(x, y, -1); } } }
public void Draw(GameTime gameTime, SpriteBatch spriteBatch, Camera camera) { if (GroundLayer != null) { GroundLayer.Draw(gameTime, spriteBatch, TileSet, camera); } if (EdgeLayer != null) { EdgeLayer.Draw(gameTime, spriteBatch, TileSet, camera); } if (BuildingLayer != null) { BuildingLayer.Draw(gameTime, spriteBatch, TileSet, camera); } if (DecorationLayer != null) { DecorationLayer.Draw(gameTime, spriteBatch, TileSet, camera); } }
public void Update(GameTime gameTime) { if (GroundLayer != null) { GroundLayer.Update(gameTime); } if (EdgeLayer != null) { EdgeLayer.Update(gameTime); } if (BuildingLayer != null) { BuildingLayer.Update(gameTime); } if (DecorationLayer != null) { DecorationLayer.Update(gameTime); } }
public void SetEdgeTile(int x, int y, int index) { EdgeLayer.SetTile(x, y, index); }
public int GetEdgeTile(int x, int y) { return(EdgeLayer.GetTile(x, y)); }
public bool HasEdge(uint fromId, uint toId) { return(EdgeLayer.Exists(x => x.From.Id == fromId && x.To.Id == toId)); }