2020-09-09 16:59:50 +00:00
using System ;
using System.Collections.Generic ;
namespace wikicreachia {
enum Locomotion {
None ,
Walker ,
Swimmer ,
Hopper ,
Flier ,
Slitherer ,
Incher
}
enum RelativeElevation {
Below ,
At ,
Above
}
class Creacher {
2020-09-09 17:13:18 +00:00
private string _name ;
public string name { get { return this . _name [ 0 ] . ToString ( ) . ToUpper ( ) + this . _name . Substring ( 1 ) ; } set { this . _name = value ; } }
public string species { get ; set ; }
2020-09-09 16:59:50 +00:00
public string biome { get ; set ; }
public int footsies { get ; set ; }
public Locomotion locomotion { get ; set ; }
public RelativeElevation elevation { get ; set ; }
2020-09-09 17:13:18 +00:00
public Creacher ( string name , string species , int footsies , string biome , Locomotion locomotion , RelativeElevation elevation ) {
2020-09-09 16:59:50 +00:00
this . name = name ;
2020-09-09 17:13:18 +00:00
this . species = species ;
2020-09-09 16:59:50 +00:00
this . footsies = footsies ;
2020-09-09 17:13:18 +00:00
this . biome = biome ;
2020-09-09 16:59:50 +00:00
this . locomotion = locomotion ;
this . elevation = elevation ;
}
public Creacher ( ) {
// empty constructor for deserialisation
}
public override string ToString ( ) {
var rng = new Random ( ) ;
string RandomItem ( List < string > list ) {
return list [ rng . Next ( list . Count ) ] ;
}
string RandomCompliment ( ) {
2020-09-09 17:13:18 +00:00
return RandomItem ( new List < string > { "wonderful" , "gorgeous" , "spectacular" , "iconic" , "precious" , "amazing" , "incredible" , "wondrous" , "fantastic" , "impeccable" , "admirable" , "long" , "precious" } ) ;
2020-09-09 16:59:50 +00:00
}
2020-09-09 17:13:18 +00:00
string output = RandomItem ( new List < string > { "Coming up next, we have" , "And here we have" , "Oh look, it's" , "Here comes" , "Look out! It's" } ) ;
2020-09-09 16:59:50 +00:00
output + = $" {this.name}! With " ;
if ( this . footsies > 5 ) {
output + = $"a whopping {this.footsies} footsies" ;
}
else if ( this . footsies > 0 ) {
output + = $"{this.footsies} footsies" ;
}
else {
output + = "not one footsy in sight" ;
}
2020-09-09 17:13:18 +00:00
output + = $", this {RandomCompliment()} {this.species} " ;
2020-09-09 16:59:50 +00:00
output + = RandomItem ( new List < string > { "usually finds itself in the" , "makes its home in the" , "truly rules the" , "will often be found in the" , "loves the" , "can't get enough of the" , "finds itself most comfortable in the" } ) ;
2020-09-09 17:13:18 +00:00
output + = $" {this.biome}. {this.name} is a {RandomCompliment()} {this.locomotion}, usually found {this.elevation.ToString().ToLower()} sea level. " ;
2020-09-09 16:59:50 +00:00
output + = RandomItem ( new List < string > { "Isn't it" , "Truly" , "Simply" , "Absolutely" , "Definitively" , "Inspiringly" , "Indescribably" } ) ;
output + = $" {RandomCompliment()}." ;
return output ;
}
}
}