Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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);
        }
Esempio n. 4
0
 public void FillEdges()
 {
     for (int y = 0; y < MapHeight; y++)
     {
         for (int x = 0; x < MapWidth; x++)
         {
             EdgeLayer.SetTile(x, y, -1);
         }
     }
 }
Esempio n. 5
0
        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);
            }
        }
Esempio n. 6
0
        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);
            }
        }
Esempio n. 7
0
 public void SetEdgeTile(int x, int y, int index)
 {
     EdgeLayer.SetTile(x, y, index);
 }
Esempio n. 8
0
 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));
 }