Skip to content

Commit f9bd11d

Browse files
committed
Lib : Added missing settings
1 parent b143ad1 commit f9bd11d

File tree

3 files changed

+103
-17
lines changed

3 files changed

+103
-17
lines changed

PCCSettingsCalculator/Program.cs

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using PearlCalculatorLib.PearlCalculationLib.Entity;
44
using PearlCalculatorLib.PearlCalculationLib.World;
55
using System;
6+
using System.ComponentModel.Design;
7+
using System.Diagnostics.CodeAnalysis;
68
using System.Dynamic;
79
using System.IO;
810
using System.Runtime.InteropServices.WindowsRuntime;
@@ -25,12 +27,14 @@ class Program
2527
static void Main(string[] args)
2628
{
2729
Console.WriteLine("Welcome to the Pearl Calculator Core Settings Generator.");
30+
Console.WriteLine("Please make sure you can see all the symbols(=) in the following line");
31+
Console.WriteLine("=====================================================================================================================");
2832
Console.WriteLine("Note :");
2933
Console.WriteLine("Please keep in mind that,");
3034
Console.WriteLine("There will be precision loss for those settings generated by this application.");
3135
Console.WriteLine("Press any key to proceed if you acknowledge the above remark and prefer using this application.");
32-
Console.ReadKey();
3336
string temp = "Start";
37+
Console.ReadKey();
3438
Settings settings = new Settings
3539
{
3640
Pearl = new PearlEntity() ,
@@ -43,12 +47,12 @@ static void Main(string[] args)
4347
if(temp == "1" || temp == "Start")
4448
{
4549
Console.WriteLine("Please enter the corrdinate of the center Of your FTL blast chamber :");
46-
chamber = ReadSurface2DFromConsole("FTL blast chamber ceter");
50+
chamber = ReadSurface2DFromConsole("FTL blast chamber ceter coordinate");
4751
}
4852
if(temp == "2" || temp == "Start")
4953
{
5054
Console.WriteLine("Please enter the coordinate of the pearl:");
51-
settings.Pearl.Position = ReadSpace3DFromConsole("Pearl position");
55+
settings.Pearl.Position = ReadSpace3DFromConsole("Pearl coordinate");
5256
}
5357
if(temp == "3" || temp == "Start")
5458
{
@@ -58,24 +62,85 @@ static void Main(string[] args)
5862
if(temp == "4" || temp == "Start")
5963
{
6064
Console.WriteLine("Please enter the coordinates of the north west TNT :");
61-
settings.NorthWestTNT = ReadSpace3DFromConsole("North west TNT position");
65+
settings.NorthWestTNT = ReadSpace3DFromConsole("North west TNT coordinate");
6266
}
6367
if(temp == "5" || temp == "Start")
6468
{
6569
Console.WriteLine("Please enter the coordinates of the north east TNT :");
66-
settings.NorthEastTNT = ReadSpace3DFromConsole("North east TNT position");
70+
settings.NorthEastTNT = ReadSpace3DFromConsole("North east TNT coordinate");
6771
}
6872
if(temp == "6" || temp == "Start")
6973
{
7074
Console.WriteLine("Please enter the coordinates of the south west TNT :");
71-
settings.SouthWestTNT = ReadSpace3DFromConsole("South west TNT position");
75+
settings.SouthWestTNT = ReadSpace3DFromConsole("South west TNT coordinate");
7276
}
7377
if(temp == "7" || temp == "Start")
7478
{
7579
Console.WriteLine("Please enter the coordinates of the south east TNT :");
76-
settings.SouthEastTNT = ReadSpace3DFromConsole("South east TNT position");
80+
settings.SouthEastTNT = ReadSpace3DFromConsole("South east TNT coordinate");
7781
}
82+
//if(temp == "9" || temp == "Start")
83+
//{
84+
// Console.WriteLine("Please set the direction of your FTL in east mode");
85+
// Console.WriteLine("Please enter the coordinates of the red TNT");
86+
// Space3D redTNT = ReadSpace3DFromConsole("Red TNT coordinate");
87+
// Console.WriteLine("Please enter the coordinates of the blue TNT");
88+
// Space3D blueTNT = ReadSpace3DFromConsole("Blue TNT coordinate");
89+
// if(redTNT.IsNorth(blueTNT))
90+
// {
91+
// settings.NorthWestTNT = redTNT;
92+
// settings.SouthWestTNT = blueTNT;
93+
// settings.DefaultRedTNTDirection = Direction.North;
94+
// settings.DefaultBlueTNTDirection = Direction.South;
95+
// }
96+
// else
97+
// {
98+
// settings.NorthWestTNT = blueTNT;
99+
// settings.SouthWestTNT = redTNT;
100+
// settings.DefaultBlueTNTDirection = Direction.North;
101+
// settings.DefaultRedTNTDirection = Direction.South;
102+
// }
103+
// Console.WriteLine("Please set the direction of your FTL in west mode");
104+
// Console.WriteLine("Please enter the coordinate of the red TNT");
105+
// redTNT = ReadSpace3DFromConsole("Red TNT coordinate");
106+
// Console.WriteLine("Please enter the coordinate of the blue TNT");
107+
// blueTNT = ReadSpace3DFromConsole("Blue TNT coordinate");
108+
// if(redTNT.IsNorth(blueTNT))
109+
110+
//}
78111
if(temp == "8" || temp == "Start")
112+
{
113+
Console.Clear();
114+
Console.WriteLine("Welcome to the Pearl Calculator Core Settings Generator.");
115+
Console.WriteLine("Please make sure you can see all the symbols(=) in the following line");
116+
Console.WriteLine("=====================================================================================================================");
117+
Console.WriteLine("Note :");
118+
Console.WriteLine("Please keep in mind that,");
119+
Console.WriteLine("There will be precision loss for those settings generated by this application.");
120+
Console.WriteLine("Press any key to proceed if you acknowledge the above remark and prefer using this application.");
121+
Console.WriteLine(" | | ");
122+
Console.WriteLine(" | | ");
123+
Console.WriteLine(" | | ");
124+
Console.WriteLine("--------+---------------------------------+--------");
125+
Console.WriteLine(" | | ");
126+
Console.WriteLine(" | | ");
127+
Console.WriteLine(" | | ");
128+
Console.WriteLine(" | | ");
129+
Console.WriteLine(" | | ");
130+
Console.WriteLine(" | | ");
131+
Console.WriteLine(" | | ");
132+
Console.WriteLine(" | | ");
133+
Console.WriteLine(" | | ");
134+
Console.WriteLine(" | | ");
135+
Console.WriteLine(" | | ");
136+
Console.WriteLine(" | | ");
137+
Console.WriteLine(" | | ");
138+
Console.WriteLine("--------+---------------------------------+--------");
139+
Console.WriteLine(" | | ");
140+
Console.WriteLine(" | | ");
141+
Console.WriteLine(" | | ");
142+
}
143+
if(temp == "9" || temp == "Start")
79144
{
80145
Console.WriteLine("Please enter the maximum amount of TNT :");
81146
temp = Console.ReadLine();

PearlCalculatorCore/Program.cs

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
using System.Collections.Generic;
99
using PearlCalculatorLib.PearlCalculationLib.Entity;
1010
using System.Collections;
11+
using System.IO;
12+
using System.Runtime.InteropServices.ComTypes;
13+
using System.IO.Compression;
1114

1215
namespace PearlCalculatorCore
1316
{
@@ -17,19 +20,32 @@ static void Main(string[] args)
1720
{
1821
Console.WriteLine("Hello World!");
1922

20-
int[] TNTConfigration = new int[10] { 1 , 2 , 4 , 8 , 16 , 32 , 64 , 128 , 256 ,512};
21-
Data.BlueTNTConfiguration.AddRange(TNTConfigration);
22-
Data.RedTNTConfiguration.AddRange(TNTConfigration);
23-
BitArray tntConfiguration = new BitArray(20);
23+
string filePath = @"G:\r.0.0.mca";
2424

25-
Calculation.CalculateTNTConfiguration(599 , 433 , out tntConfiguration);
25+
Console.WriteLine("File Exists : " + File.Exists(filePath).ToString());
2626

27-
foreach(var temp in tntConfiguration)
28-
{
29-
Console.WriteLine(temp.ToString());
30-
}
27+
3128

29+
Console.WriteLine("End");
3230
Console.ReadKey();
3331
}
32+
33+
public static void Decompress(FileInfo fileToDecompress)
34+
{
35+
using(FileStream originalFileStream = fileToDecompress.OpenRead())
36+
{
37+
string currentFileName = fileToDecompress.FullName;
38+
string newFileName = currentFileName.Remove(currentFileName.Length - fileToDecompress.Extension.Length);
39+
40+
using(FileStream decompressedFileStream = File.Create(newFileName))
41+
{
42+
using(GZipStream decompressionStream = new GZipStream(originalFileStream , CompressionMode.Decompress))
43+
{
44+
decompressionStream.CopyTo(decompressedFileStream);
45+
Console.WriteLine($"Decompressed: {fileToDecompress.Name}");
46+
}
47+
}
48+
}
49+
}
3450
}
3551
}

PearlCalculatorLib/General/Settings.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class Settings
2525
public int BlueTNT;
2626
public int MaxTNT;
2727
public Direction Direction;
28+
public Direction DefaultRedTNTDirection;
29+
public Direction DefaultBlueTNTDirection;
2830

2931
public static Settings CreateSettingsFormData() => new Settings()
3032
{
@@ -42,7 +44,10 @@ public class Settings
4244
Destination = Data.Destination ,
4345
Offset = Data.PearlOffset ,
4446

45-
Direction = Data.Direction
47+
Direction = Data.Direction ,
48+
49+
DefaultRedTNTDirection = Data.DefaultRedDuper ,
50+
DefaultBlueTNTDirection = Data.DefaultBlueDuper
4651
};
4752
}
4853
}

0 commit comments

Comments
 (0)