using System; using System.Text; using Newtonsoft.Json; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations; namespace Kehyeedra3.Services.Models { public class Farming { [Key] public ulong Id { get; set; } = 0; public int Tier { get; set; } = 0; public int EmployeeCount { get; set; } = 0; public ulong Lvl { get; set; } = 0; public ulong Xp { get; set; } = 50; public ulong FXp { get; set; } = 0; public ulong TXp { get; set; } = 0; [Column(TypeName = "LONGTEXT")] public string CropInventory { get; set; } = "{}"; [Column(TypeName = "LONGTEXT")] public string PlotInventory { get; set; } = "{}"; public Dictionary GetCropInventory() { return JsonConvert.DeserializeObject>(CropInventory); } public Dictionary GetPlotInventory() { return JsonConvert.DeserializeObject>(PlotInventory); } public void SetCropInventory(Dictionary inv) { Dictionary temp = new Dictionary(); foreach (var entry in inv) { temp.Add((int)entry.Key, entry.Value); } CropInventory = JsonConvert.SerializeObject(temp); } public void SetPlotInventory(Dictionary inv) { Dictionary temp = new Dictionary(); foreach (var entry in inv) { temp.Add((int)entry.Key, entry.Value); } PlotInventory = JsonConvert.SerializeObject(temp); } public static List ListCrops() { return new List { new FCrop() { Id = FarmCrop.Wheat, Name = "Wheat", Description = "Common wheat, 'Triticum aestivum' is the most widely grown cereal grain, you should get in on it before we reach peak wheat.", Type = FarmType.Plant, Tier = FarmTier.T0, GrowTime = 10, Price = 100, }, new FCrop() { Id = FarmCrop.Rye, Name = "Rye", Description = "Rye, 'Secale cereale' is a hardy cereal grain, grows slower than wheat, but also tastes better.", Type = FarmType.Plant, Tier = FarmTier.T1, GrowTime = 15, Price = 150, }, new FCrop() { Id = FarmCrop.Lettuce, Name = "Lettuce", Description = "Lettuce, 'Lactuca sativa' is an annual daisy plant first cultivated in ancient Egypt, worshipped as ancient viagra. Incidentally, it can be harvested very often.", Type = FarmType.Plant, Tier = FarmTier.T2, GrowTime = 5, Price = 200, }, new FCrop() { Id = FarmCrop.Leek, Name = "Leek", Description = "Leek, 'Allium ampeloprasum' is an onion, the word leek is derived from the old english word 'leac', it has a medium growth time. I know what you're thinking about doing and I want you to stop right now.", Type = FarmType.Plant, Tier = FarmTier.T3, GrowTime = 13, Price = 250, }, new FCrop() { Id = FarmCrop.Bookweed, Name = "Bookweed", Description = "Bookweed, 'Lactuca liber' is an enchanted variant of lettuce used for special crafting. Eating it by itself is said to give you diarrhea.", Type = FarmType.Plant, Tier = FarmTier.T4, GrowTime = 50, Price = 0, }, new FCrop() { Id = FarmCrop.LuckyLeek, Name = "Polkka", Description = "Polkka, 'Allium dexter' is an enchanted variant of leek used for special crafting. It contains a natural power to spin, and can be used as a green energy source. If you're a huge faggot.", Type = FarmType.Plant, Tier = FarmTier.T5, GrowTime = 50, Price = 0, }, }; } public static List ListFarmLand() { return new List { new FLand() { Id = FarmLand.Backyard, Name = "Backyard", Type = FarmType.Plant, Tier = FarmTier.T0, WorkerMax = 1, Price = 0 }, new FLand() { Id = FarmLand.Bathtub, Name = "Bathtub", Type = FarmType.Fish, Tier = FarmTier.T0, WorkerMax = 1, Price = 0, }, new FLand() { Id = FarmLand.SPlot, Name = "Small Plot", Type = FarmType.Plant, Tier = FarmTier.T1, WorkerMax = 2, Price = 600 }, new FLand() { Id = FarmLand.MPlot, Name = "Medium Plot", Type = FarmType.Plant, Tier = FarmTier.T2, WorkerMax = 4, Price = 1000 }, new FLand() { Id = FarmLand.LPlot, Name = "Large Plot", Type = FarmType.Plant, Tier = FarmTier.T3, WorkerMax = 6, Price = 1400 }, }; } } public enum FarmLand { Backyard = 0, Bathtub = 1, SPlot = 2, MPlot = 3, LPlot = 4, } public enum FarmType { Any = 0, Plant = 1, Mushroom = 2, Fish = 3, } public enum FarmCrop { Wheat = 0, Rye = 1, Lettuce = 2, Leek = 3, LuckyLeek = 100, Bookweed = 101, } public enum FarmTier { T0 = 0, T1 = 1, T2 = 2, T3 = 3, T4 = 4, T5 = 5, } public class FLand { public FarmLand Id { get; set; } public string Name { get; set; } public string Description { get; set; } public FarmType Type { get; set; } public FarmTier Tier { get; set; } public int WorkerMax { get; set; } public int Price { get; set; } } public class FCrop { public FarmCrop Id { get; set; } public string Name { get; set; } public string Description { get; set; } public FarmType Type { get; set; } public FarmTier Tier { get; set; } public int GrowTime { get; set; } public int Price { get; set; } } public class PlotObject { [Key] public ulong PlotId { get; set; } = 0; [Required] public ulong UserId { get; set; } = 0; public ulong Planted { get; set; } = 0; public ulong Grown { get; set; } = 0; public int FarmType { get; set; } = 0; public int WorkerAmount { get; set; } = 0; } public class FCropSlot { public int Id; public int Seeds; public int Produce; } public class FPlotSlot { public int Id; public int Amount; } }