---
# System prepended metadata

title: Diagramme des classes logique Finale

---

# Diagramme des classes logique Finale

```mermaid
classDiagram

class Boid {
    -pos
    -velocity
    -acceleration
    -colors
    -coefficient
    
    +update(Container c, double delta)
    +draw(GraphicsContext gc)
    +setCoefficient(double)
    #separationRule(Container c)
    #cohesionRule(Container c)
    #alignementRule(Container c)
    #gradientRule(Container c)
}

class BoidsContainer {
    <<interface>>
    +add(Boid boid)
    +add(Vector2D)
    +update(double delta)
    +draw(GraphicsContext gc)
    +setCoefs(double separation, double alignment, double cohesion)
    +setRadius(double radius, double mouse)
    +getBoidsNear() List~Boid~
    +getObstacleNear() List~Vector2D~ 
    +clearObstacle()
}

class GridContainer {
    -List<List<List<Boid>>> boidGrid
    -List<List<List<Vector2D>>> obstacleGrid
    -double cellRadius
    -double width
    -double height
}

BoidsContainer <|-- GridContainer

class SimpleContainer {
    -List<Boid> boids
    -HashSet<Vector2D> obstacles
}

BoidsContainer <|-- SimpleContainer

class MouseMode{
    <<enumeration>>
    ADD_BOID
    ADD_OBSTACLE
    BOIDS_AVOID
    BOIDS_FOLLOW
}

class MusicPlayer{
    -MediaPlayer
}

class Obstacle {
    -List~Double~ xList
    -List~Double~ yList
    -LinearGradient gradient
    
    +addPoint(double x, double y)
    +draw(GraphicsContext gc)
    -toArray(List~Double~ list) : double[]
}

class WindowMouse {
    -double width
    -double height
    -Vector2D mousePos
    -MouseMode mouseMode
    +setHeight(double)
    +setWidth(double)
    +setMousePos(Vector2D)
    +setsetMouseReleased()
    +setMouseMode(MouseMode mouseMode)
    +getHeight() : double
    +getWidth() : double
    +getMousePos() : Vector2D
    +getMouseMode() : MouseMode
    +isPressed() : boolean
}



Boid *-- BoidsContainer

```