added back + exit functionality for creach addition

This commit is contained in:
Pecha 2020-09-14 21:56:07 +10:00
parent 7c692f0369
commit ffde3b80d7
7 changed files with 23 additions and 37 deletions

View File

@ -35,7 +35,7 @@ namespace creachopedia {
case "add":
switch (substatus) {
case 1:
Console.WriteLine("Please enter a name for the creacher! Or type (b) for previous category, or (q) to cancel addition entirely.");
Console.WriteLine("Please enter a name for the creacher! Or type (x) to cancel and step back to the previous category, or (q) to cancel addition entirely.");
break;
case 2:
Console.WriteLine("How many footsies? 0u0 (numerals only plz)");
@ -59,11 +59,11 @@ namespace creachopedia {
string userin = Console.ReadLine();
string luserin = userin.ToLower();
if (luserin == "q" || luserin == "quit") {
Console.WriteLine("Thank you for using the CreachoPedia, please come again!!!!");
return;
}
if (status == "base") {
if (luserin == "q" || luserin == "quit") {
Console.WriteLine("Thank you for using the CreachoPedia, please come again!!!!");
return;
}
if (creacherdict.ContainsKey(userin)) {
creacherdict[userin].Introduce();
creacherdict[userin].Step();
@ -82,7 +82,19 @@ namespace creachopedia {
}
}
else if (status == "add") {
if (substatus == 1) {
if (luserin == "x") {
substatus--;
luserin = "";
}
else if (luserin == "q") {
status = "base";
}
else if (substatus == 0) {
status = "base";
substatus = 1;
Console.WriteLine("please hit enter to continue");
}
else if (substatus == 1) {
tempdict = new Dictionary<string, string>();
var namematcher = new Regex(@"[^ ].[A-Za-z\- ]{2,}(?<! )");
if (namematcher.Match(userin).Success) {
@ -141,9 +153,9 @@ namespace creachopedia {
status = "base";
substatus = 1;
}
foreach (var i in tempdict) {
Console.WriteLine("{0}:{1}", i.Key, i.Value);
}
// foreach (var i in tempdict) {
// Console.WriteLine("{0}:{1}", i.Key, i.Value);
// }
}
Console.WriteLine("");

View File

@ -1,20 +0,0 @@
{
"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
}
}

View File

@ -1,10 +1,4 @@
name, footsycount, biome, locomotion, surfacerel,
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
- ability to add individuals without a previously-created species by creating them together
- fix "creacher of the urban" and such formatting issues