root/src/AIRendering/DrawableGrid.cs

User picture

Author: conkerjo

Revision: 30 («Previous)


File Size: 2.01 KB

(July 08, 2009 19:40 UTC) Almost 3 years ago


  

 
Show/hide line numbers
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Brains.Framework;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Brains.Framework.Map;

namespace AIRendering
{
    public class DrawableGrid : Grid, IRender
    {
        public DrawableGrid()
        {

        }

        public DrawableGrid(int width, int height, int cellSize)
            : base(width, height, cellSize)
        {

        }
        public DrawableGrid(Vector2 position, int width, int height, int cellsize)
            : base(position, width, height, cellsize)
        {
        }


        public virtual  void Render(PrimitiveBatch batch)
        {

            //for (int y = 0; y < Rows; y++)
            //{
            //    for (int x = 0; x < Cols; x++)
            //    {
            //        batch.DrawLine(
            //            Position+new Vector2(x * CellSize, 0),
            //            Position + new Vector2(x * CellSize, Height),
            //            Color.White);

            //        GridCell cell = GetCell(x, y);


            //        if (cell.Type == 0)
            //        {
            //            Vector2 half = new Vector2(CellSize / 2);
            //            batch.DrawLine(
            //                GetCell(x,y).Position -half,
            //                GetCell(x,y).Position +half,
            //                Color.Red);


            //            batch.DrawLine(
            //                GetCell(x, y).Position - new Vector2(half.X,-half.Y),
            //                GetCell(x, y).Position + new Vector2(half.X,-half.Y),
            //                Color.Red);
            //        }
            //    }
            //    batch.DrawLine(
            //            Position + new Vector2(0, y * CellSize),
            //            Position + new Vector2(Width, y * CellSize),
            //            Color.White);


            //}

        }

    }      
}