using AlienAttack.MonoGame.Things.Bullets;
using AlienAttack.MonoGame.Things.Muzzles;
using Microsoft.Xna.Framework;
using System;

namespace AlienAttack.MonoGame.Things.Weapons;

public record FireBulletContext
{
    public Sprite Owner { get; init; }
    public SpriteUpdateContext SpriteUpdateContext { get; init; }
    public int BulletWidth { get; init; }
    public int BulletHeight { get; init; }
    public Anchor Anchor { get; init; }
    public Shot[] Shots { get; init; }
    public Func<float, float, float, float, Sprite, Bullet> Factory { get; init; }
}

public record Shot
{
    public float OffsetX { get; init; }
    public float OffsetY { get; init; }
    public float XVelocity { get; init; }
    public float YVelocity { get; init; }
}

public record FireBulletFromMuzzleContext
{
    public Sprite Owner { get; init; }
    public SpriteUpdateContext SpriteUpdateContext { get; init; }
    public int BulletWidth { get; init; }
    public int BulletHeight { get; init; }
    public MuzzleShot[] Shots { get; init; }
    public Vector2 ExtraOffset { get; init; } = default;
    public Func<float, float, float, float, Sprite, Bullet> Factory { get; init; }
}

public record MuzzleShot
{
    public MuzzleId Muzzle { get; init; }
    public float XVelocity { get; init; }
    public float YVelocity { get; init; }
}