52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using GTANetworkAPI;
|
|
using ReallifeGamemode.Database.Entities.Saves;
|
|
using ReallifeGamemode.Database.Models;
|
|
using ReallifeGamemode.Server.Shop.Clothing;
|
|
|
|
namespace ReallifeGamemode.Server.Managers
|
|
{
|
|
public class ShopManager
|
|
{
|
|
|
|
public static List<ClotheShop> clotheStores = new List<ClotheShop>();
|
|
|
|
public static void LoadClotheShops()
|
|
{
|
|
using(var dbContext = new DatabaseContext())
|
|
{
|
|
List<SavedBlip> discount = dbContext.Blips.ToList().FindAll(s => s.Name == "Binco" || s.Name == "Discount Store");
|
|
List<SavedBlip> midclass = dbContext.Blips.ToList().FindAll(s => s.Name == "Suburban");
|
|
List<SavedBlip> luxury = dbContext.Blips.ToList().FindAll(s => s.Name == "Ponsonbys");
|
|
|
|
foreach(var store in discount) {
|
|
Vector3 pos = new Vector3(store.PositionX, store.PositionY, store.PositionZ);
|
|
ClotheShop newShop = new ClotheShop(1, pos);
|
|
clotheStores.Add(newShop);
|
|
NAPI.Util.ConsoleOutput($"Loading ClotheShop {store.Name}");
|
|
}
|
|
foreach(var store in midclass)
|
|
{
|
|
Vector3 pos = new Vector3(store.PositionX, store.PositionY, store.PositionZ);
|
|
ClotheShop newShop = new ClotheShop(2, pos);
|
|
clotheStores.Add(newShop);
|
|
NAPI.Util.ConsoleOutput($"Loading ClotheShop {store.Name}");
|
|
}
|
|
foreach (var store in luxury)
|
|
{
|
|
Vector3 pos = new Vector3(store.PositionX, store.PositionY, store.PositionZ);
|
|
ClotheShop newShop = new ClotheShop(2, pos);
|
|
clotheStores.Add(newShop);
|
|
NAPI.Util.ConsoleOutput($"Loading ClotheShop {store.Name}");
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|