import 'package:ecosim/src/ecosim/models/boid.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

import '../ecosim/models/food.dart';
import '../ecosim/models/poison.dart';
import '../seeking/models/pointer_indicator.dart';

class BenchmarkSimulationPainter extends CustomPainter {
  final double x;
  final double y;
  final PointerIndicator pointerIndicator;
  final List<Boid> boids;
  final List<Food> foods;
  final List<Poison> poison;

  BenchmarkSimulationPainter(
    this.pointerIndicator,
    this.x,
    this.y,
    this.boids,
    this.foods,
    this.poison,
  );

  @override
  void paint(Canvas canvas, Size size) {
    for (var boid in boids) {
      boid.render(canvas);
    }

    for (var food in foods) {
      food.render(canvas);
    }

    for (var poison in poison) {
      poison.render(canvas);
    }

    final white = Paint()..color = const Color.fromARGB(255, 255, 255, 255);
    white.style = PaintingStyle.stroke;

    canvas.drawRect(
      Rect.fromCenter(
        center: const Offset(500, 500),
        width: 1200,
        height: 1200,
      ),
      white,
    );
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}
