Skip to content
Snippets Groups Projects
Commit 9b9b9197 authored by Sebastian Schwarz's avatar Sebastian Schwarz
Browse files

Cards fix + CardsToFile Method added

parent 832e4956
No related branches found
No related tags found
No related merge requests found
Showing
with 102 additions and 13 deletions
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/contentModel.xml
/.idea.Levenshtein.iml
/modules.xml
/projectSettingsUpdater.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
...@@ -12,7 +12,7 @@ namespace Levenshtein ...@@ -12,7 +12,7 @@ namespace Levenshtein
public void ReadFromScrambled() public void ReadFromScrambled()
{ {
var read = System.IO.File.ReadLines(@"C:\Users\juanl\Studium Info\Informatik 3\scrambled.txt"); var read = System.IO.File.ReadLines(@"E:\Downloads\scrambled.txt");
foreach (string line in read) foreach (string line in read)
{ {
...@@ -21,19 +21,26 @@ namespace Levenshtein ...@@ -21,19 +21,26 @@ namespace Levenshtein
{ {
Name = part[0], Name = part[0],
Mana = part[1], Mana = part[1],
Cmc = int.Parse(part[2]), Cmc = double.Parse(part[2]),
Type = part[3], Type = part[3],
Count = int.Parse(part[4]), Count = double.Parse(part[4]),
}; };
System.Console.WriteLine(card.Name);
System.Console.WriteLine(card.Mana);
System.Console.WriteLine(card.Cmc);
System.Console.WriteLine(card.Type);
System.Console.WriteLine(card.Count);
_cards.Add(card); _cards.Add(card);
System.Console.WriteLine(_cards.Count());
} }
} }
public void CardsToFile()
{
using (StreamWriter writer = new StreamWriter(@"E:\Downloads\test.txt"))
{
foreach (Cards card in _cards)
{
writer.WriteLine(card.Name + "|" + card.Mana + "|" + card.Cmc + "|" + card.Type + "|" + card.Count);
}
}
}
} }
} }
...@@ -10,9 +10,9 @@ namespace Levenshtein ...@@ -10,9 +10,9 @@ namespace Levenshtein
{ {
public string Name { get; set; } public string Name { get; set; }
public string Mana { get; init; } public string Mana { get; init; }
public int Cmc { get; init; } public double Cmc { get; init; }
public string Type { get; init; } public string Type { get; init; }
public int Count { get; init; } public double Count { get; init; }
} }
......
...@@ -15,7 +15,8 @@ namespace Levenshtein ...@@ -15,7 +15,8 @@ namespace Levenshtein
CardMechanic test1 = new CardMechanic(); CardMechanic test1 = new CardMechanic();
test1.ReadFromScrambled(); test1.ReadFromScrambled();
test1.CardsToFile();
......
No preview for this file type
No preview for this file type
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"Levenshtein/1.0.0": {
"runtime": {
"Levenshtein.dll": {}
}
}
}
},
"libraries": {
"Levenshtein/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
\ No newline at end of file
File added
File added
File added
{
"runtimeOptions": {
"tfm": "net6.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
"configProperties": {
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false
}
}
}
\ No newline at end of file
...@@ -7,4 +7,4 @@ build_property.InvariantGlobalization = ...@@ -7,4 +7,4 @@ build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly = build_property.PlatformNeutralAssembly =
build_property._SupportedPlatformList = Linux,macOS,Windows build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Levenshtein build_property.RootNamespace = Levenshtein
build_property.ProjectDir = C:\Users\juanl\Studium Info\Informatik 3\informatik_3_abgaben_beachboys\Levenshtein\ build_property.ProjectDir = C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\
No preview for this file type
No preview for this file type
...@@ -28,3 +28,18 @@ C:\Users\juanl\Studium Info\Informatik 3\informatik_3_abgaben_beachboys\Levensht ...@@ -28,3 +28,18 @@ C:\Users\juanl\Studium Info\Informatik 3\informatik_3_abgaben_beachboys\Levensht
C:\Users\juanl\Studium Info\Informatik 3\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.pdb C:\Users\juanl\Studium Info\Informatik 3\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.pdb
C:\Users\juanl\Studium Info\Informatik 3\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.genruntimeconfig.cache C:\Users\juanl\Studium Info\Informatik 3\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.genruntimeconfig.cache
C:\Users\juanl\Studium Info\Informatik 3\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\ref\Levenshtein.dll C:\Users\juanl\Studium Info\Informatik 3\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\ref\Levenshtein.dll
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\bin\Debug\net6.0\Levenshtein.exe
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\bin\Debug\net6.0\Levenshtein.deps.json
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\bin\Debug\net6.0\Levenshtein.runtimeconfig.json
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\bin\Debug\net6.0\Levenshtein.dll
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\bin\Debug\net6.0\Levenshtein.pdb
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.csproj.AssemblyReference.cache
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.AssemblyInfoInputs.cache
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.AssemblyInfo.cs
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.csproj.CoreCompileInputs.cache
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.dll
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\refint\Levenshtein.dll
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.pdb
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\Levenshtein.genruntimeconfig.cache
C:\Users\Seppl\source\repos\informatik_3_abgaben_beachboys\Levenshtein\obj\Debug\net6.0\ref\Levenshtein.dll
No preview for this file type
b4098bab2c2f3026f036107aca4eb215ad6f7aa1 ddfdae3fb9c573dd3461ae0edafc206c9fdccf85
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment