1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71 |
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);
//}
}
}
} |