using System;
using System.Collections.Generic;
using System.Linq;
using GTANetworkAPI;

namespace ReallifeGamemode.Server.WeaponDeal
{
  public class WeaponDealPoints
  {
    public static Dictionary<int, int> factionWeaponDeal = new Dictionary<int, int>();

    public static readonly IReadOnlyCollection<Vector3> WT_Route = new List<Vector3>
    {
        //new Vector3(2465.163, 1589.396, 32.72029), ungeeignet
        new Vector3(1532.045, 1702.775, 107.7561), //Hütte iwo Östlich
        new Vector3(58.67861, 3717.103, 37.75301), //Lost MC
        new Vector3(-2174.734, 4269.301, 46.95574), //Army Base
        new Vector3(2530.14, 2617.15, 35.76),
        new Vector3(-3179.78, 820.08, 1.59),
        new Vector3(-1889.91, 2045.6, 138.68)
    }.AsReadOnly();

    public static readonly IReadOnlyCollection<Vector3> StaatsFrakWT_Route = new List<Vector3>
    {

        new Vector3(3627.138, 3759.711, 28.515)

    }.AsReadOnly();

    public static Vector3 getRndWD_Route(int factionID)
    {
      if (!factionWeaponDeal.ContainsKey(factionID))
        return new Vector3();

      if(factionID == 1 | factionID == 3)
      {
        Random rnd = new Random();
        factionWeaponDeal[factionID] = rnd.Next(0, StaatsFrakWT_Route.Count - 1);
        return StaatsFrakWT_Route.ElementAt(factionWeaponDeal[factionID]);
      }
      else
      {
        Random rnd = new Random();
        factionWeaponDeal[factionID] = rnd.Next(0, WT_Route.Count - 1);
        return WT_Route.ElementAt(factionWeaponDeal[factionID]);
      }

   /*   if (factionWeaponDeal[factionID] == -1)
      {
        Random rnd = new Random();
        factionWeaponDeal[factionID] = rnd.Next(0, WT_Route.Count - 1);
      }
      return WT_Route.ElementAt(factionWeaponDeal[factionID]);
      
   */
    }
  }
}
