public FieldDrawable(Field field, int x, int y, int width, int height) : base(x, y, width, height) { this.field = field; cellWidth = width / field.GetWidth(); cellHeight = height / field.GetHeight(); TempInitImages(); field.ScheduleTimer(BlinkTimerCallback, 0.01f, true); }
private void DrawGrid(Context context) { if (CVars.g_drawGrid.boolValue) { for (int i = 0; i <= field.GetWidth(); ++i) { context.DrawLine(i * cellWidth, 0, i * cellWidth, height, Color.Gray); } for (int i = 0; i <= field.GetHeight(); ++i) { context.DrawLine(0, i * cellHeight, width, i * cellHeight, Color.Gray); } } }