diff --git a/.vscode/launch.json b/.vscode/launch.json index f138aea..232a8e2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,7 +14,7 @@ "args": [], "cwd": "${workspaceFolder}", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console - "console": "internalConsole", + "console": "integratedTerminal", "stopAtEntry": false }, { diff --git a/Creacher.cs b/Creacher.cs index 49e2936..0526cb1 100644 --- a/Creacher.cs +++ b/Creacher.cs @@ -43,6 +43,8 @@ namespace creachopedia { if(this.footsies == 0){ Console.WriteLine("I cannot stip or step! I have 0 footsies! I am however quite powerful in my own way 0u0"); Console.WriteLine("Silly creacher..."); + } else if(footsies == 1){ + Console.WriteLine($"The {this.name} only has 1 footsie, but it does its best."); } else { Console.WriteLine($"The {this.name} steps, and rather well I might add."); } diff --git a/Program.cs b/Program.cs index 2e37780..7afcff4 100644 --- a/Program.cs +++ b/Program.cs @@ -13,14 +13,18 @@ namespace creachopedia { var substatus = 1; var tempdict = new Dictionary(); var creacherdict = JsonConvert.DeserializeObject>(File.ReadAllText("creachopedia.json")); - // creacherdict.Add("paca", new GroundCreacher("paca", 4)); - // creacherdict.Add("llama", new GroundCreacher("llama", 4)); - // creacherdict.Add("stingray", new WaterCreacher("stingray", 0)); - // var jsonsettings = new JsonSerializerSettings{ - // TypeNameHandling = TypeNameHandling.Auto - // }; - // string jsonstring = JsonConvert.SerializeObject(creacherdict, Formatting.Indented, jsonsettings); - // File.WriteAllText("creachopedia.json", jsonstring); + var shortdefs = new Dictionary(){ + {"a", "At"}, + {"b", "Below"}, + {"v", "Above"}, + {"n", "None"}, + {"w", "Walker"}, + {"s", "Swimmer"}, + {"h", "Hopper"}, + {"f", "Flier"}, + {"l", "Slitherer"}, + {"i", "Incher"} + }; while (true) { @@ -46,6 +50,8 @@ namespace creachopedia { case 5: Console.WriteLine("Please enter your creacher's relation to the surface: [b]elow, [a]t, abo[v]e"); break; + case 6: + break; } break; } @@ -120,15 +126,20 @@ namespace creachopedia { var relsurfacematcher = new Regex(@"^[abv]$"); if (relsurfacematcher.Match(luserin).Success) { tempdict.Add("surfacerel", luserin); - substatus ++; + substatus++; } - else { Console.WriteLine("Sorry, this surface relation did not match one of the three listed above. Please try again."); } } else if (substatus == 6) { - return; + Console.WriteLine("test0"); + var tempcreach = new Creacher(tempdict["name"], int.Parse(tempdict["footsies"]), tempdict["biome"], (Locomotion)Enum.Parse(typeof(Locomotion), shortdefs[tempdict["locomethod"]]), (SurfaceRel)Enum.Parse(typeof(SurfaceRel), shortdefs[tempdict["surfacerel"]])); + creacherdict.Add(tempdict["name"], tempcreach); + File.WriteAllText("creachopedia.json", JsonConvert.SerializeObject(creacherdict, Formatting.Indented)); + Console.WriteLine("Creacher adde! 0u0"); + status = "base"; + substatus = 1; } foreach (var i in tempdict) { Console.WriteLine("{0}:{1}", i.Key, i.Value); @@ -136,7 +147,7 @@ namespace creachopedia { } Console.WriteLine(""); - Thread.Sleep(1000); + Thread.Sleep(500); } } } diff --git a/bin/Debug/netcoreapp3.1/creachopedia.dll b/bin/Debug/netcoreapp3.1/creachopedia.dll index 9c510e3..78674ee 100644 Binary files a/bin/Debug/netcoreapp3.1/creachopedia.dll and b/bin/Debug/netcoreapp3.1/creachopedia.dll differ diff --git a/bin/Debug/netcoreapp3.1/creachopedia.pdb b/bin/Debug/netcoreapp3.1/creachopedia.pdb index f58a7ab..2eaf104 100644 Binary files a/bin/Debug/netcoreapp3.1/creachopedia.pdb and b/bin/Debug/netcoreapp3.1/creachopedia.pdb differ diff --git a/creachopedia.json b/creachopedia.json index 47126eb..0c11d93 100644 --- a/creachopedia.json +++ b/creachopedia.json @@ -1,20 +1,22 @@ { "paca": { - "$type": "creachopedia.GroundCreacher, creachopedia", "type": "creacher of the land", "name": "paca", "_footsies": 4 }, "llama": { - "$type": "creachopedia.GroundCreacher, creachopedia", "type": "creacher of the land", "name": "llama", "_footsies": 4 }, "stingray": { - "$type": "creachopedia.WaterCreacher, creachopedia", "type": "creacher of the water", "name": "stingray", "_footsies": 0 - } + }, + "Snool": { + "type": "creacher of the urban", + "name": "Snool", + "_footsies": 1 + } } \ No newline at end of file diff --git a/json.bak b/json.bak new file mode 100644 index 0000000..47126eb --- /dev/null +++ b/json.bak @@ -0,0 +1,20 @@ +{ + "paca": { + "$type": "creachopedia.GroundCreacher, creachopedia", + "type": "creacher of the land", + "name": "paca", + "_footsies": 4 + }, + "llama": { + "$type": "creachopedia.GroundCreacher, creachopedia", + "type": "creacher of the land", + "name": "llama", + "_footsies": 4 + }, + "stingray": { + "$type": "creachopedia.WaterCreacher, creachopedia", + "type": "creacher of the water", + "name": "stingray", + "_footsies": 0 + } +} \ No newline at end of file diff --git a/note.txt b/note.txt index 9ca607e..f2d5a33 100644 --- a/note.txt +++ b/note.txt @@ -1,4 +1,10 @@ -name, footsycount, biome///, locomotion, surfacerel, +name, footsycount, biome, locomotion, surfacerel, -None, Walker, Swimmer, Hopper, Flier, Slitherer, Incher \ No newline at end of file +None, Walker, Swimmer, Hopper, Flier, Slitherer, Incher + + +FOR NEXT VERSION: + - individuals/species distinction + - ability to add individuals without a previously-created species by creating them together + - maybe get rid of Newtonsoft JSON stuff- polymorphism no longer necessary w/ sunsetting of inheritance \ No newline at end of file diff --git a/obj/Debug/netcoreapp3.1/creachopedia.dll b/obj/Debug/netcoreapp3.1/creachopedia.dll index 9c510e3..78674ee 100644 Binary files a/obj/Debug/netcoreapp3.1/creachopedia.dll and b/obj/Debug/netcoreapp3.1/creachopedia.dll differ diff --git a/obj/Debug/netcoreapp3.1/creachopedia.pdb b/obj/Debug/netcoreapp3.1/creachopedia.pdb index f58a7ab..2eaf104 100644 Binary files a/obj/Debug/netcoreapp3.1/creachopedia.pdb and b/obj/Debug/netcoreapp3.1/creachopedia.pdb differ