add a new entry subclass for MarketBuy
This commit is contained in:
		
							parent
							
								
									f870052d84
								
							
						
					
					
						commit
						e3e67b0849
					
				
							
								
								
									
										1
									
								
								Entry.cs
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								Entry.cs
									
									
									
									
									
								
							@ -20,6 +20,7 @@ namespace EDJournal {
 | 
				
			|||||||
            { Events.FSDJump, typeof(FSDJumpEntry) },
 | 
					            { Events.FSDJump, typeof(FSDJumpEntry) },
 | 
				
			||||||
            { Events.HullDamage, typeof(HullDamageEntry) },
 | 
					            { Events.HullDamage, typeof(HullDamageEntry) },
 | 
				
			||||||
            { Events.Location, typeof(LocationEntry) },
 | 
					            { Events.Location, typeof(LocationEntry) },
 | 
				
			||||||
 | 
					            { Events.MarketBuy, typeof(MarketBuyEntry) },
 | 
				
			||||||
            { Events.MarketSell, typeof(MarketSellEntry) },
 | 
					            { Events.MarketSell, typeof(MarketSellEntry) },
 | 
				
			||||||
            { Events.MissionAbandoned, typeof(MissionAbandonedEntry) },
 | 
					            { Events.MissionAbandoned, typeof(MissionAbandonedEntry) },
 | 
				
			||||||
            { Events.MissionAccepted, typeof(MissionAcceptedEntry) },
 | 
					            { Events.MissionAccepted, typeof(MissionAcceptedEntry) },
 | 
				
			||||||
 | 
				
			|||||||
@ -9,6 +9,7 @@
 | 
				
			|||||||
        public static readonly string FSDJump = "FSDJump";
 | 
					        public static readonly string FSDJump = "FSDJump";
 | 
				
			||||||
        public static readonly string HullDamage = "HullDamage";
 | 
					        public static readonly string HullDamage = "HullDamage";
 | 
				
			||||||
        public static readonly string Location = "Location";
 | 
					        public static readonly string Location = "Location";
 | 
				
			||||||
 | 
					        public static readonly string MarketBuy = "MarketBuy";
 | 
				
			||||||
        public static readonly string MarketSell = "MarketSell";
 | 
					        public static readonly string MarketSell = "MarketSell";
 | 
				
			||||||
        public static readonly string MissionAbandoned = "MissionAbandoned";
 | 
					        public static readonly string MissionAbandoned = "MissionAbandoned";
 | 
				
			||||||
        public static readonly string MissionAccepted = "MissionAccepted";
 | 
					        public static readonly string MissionAccepted = "MissionAccepted";
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										21
									
								
								MarketBuyEntry.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								MarketBuyEntry.cs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,21 @@
 | 
				
			|||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace EDJournal {
 | 
				
			||||||
 | 
					    public class MarketBuyEntry : Entry {
 | 
				
			||||||
 | 
					        public string Type { get; set; }
 | 
				
			||||||
 | 
					        public int Count { get; set; }
 | 
				
			||||||
 | 
					        public int BuyPrice { get; set; }
 | 
				
			||||||
 | 
					        public int TotalCost { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        protected override void Initialise() {
 | 
				
			||||||
 | 
					            Type = JSON.Value<string>("Type") ?? "";
 | 
				
			||||||
 | 
					            Count = JSON.Value<int?>("Count") ?? 0;
 | 
				
			||||||
 | 
					            BuyPrice = JSON.Value<int?>("BuyPrice") ?? 0;
 | 
				
			||||||
 | 
					            TotalCost = JSON.Value<int?>("TotalCost") ?? 0;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -55,6 +55,7 @@
 | 
				
			|||||||
    <Compile Include="JournalFile.cs" />
 | 
					    <Compile Include="JournalFile.cs" />
 | 
				
			||||||
    <Compile Include="JournalStream.cs" />
 | 
					    <Compile Include="JournalStream.cs" />
 | 
				
			||||||
    <Compile Include="LocationEntry.cs" />
 | 
					    <Compile Include="LocationEntry.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="MarketBuyEntry.cs" />
 | 
				
			||||||
    <Compile Include="MarketSellEntry.cs" />
 | 
					    <Compile Include="MarketSellEntry.cs" />
 | 
				
			||||||
    <Compile Include="MissionAbandonedEntry.cs" />
 | 
					    <Compile Include="MissionAbandonedEntry.cs" />
 | 
				
			||||||
    <Compile Include="MissionAcceptedEntry.cs" />
 | 
					    <Compile Include="MissionAcceptedEntry.cs" />
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user