WikiCreachia/Creacher.cs

71 lines
2.4 KiB
C#

using System;
using System.Collections.Generic;
namespace wikicreachia {
enum Locomotion {
None,
Walker,
Swimmer,
Hopper,
Flier,
Slitherer,
Incher
}
enum RelativeElevation {
Below,
At,
Above
}
class Creacher {
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; }
public string biome { get; set; }
public int footsies { get; set; }
public Locomotion locomotion { get; set; }
public RelativeElevation elevation { get; set; }
public Creacher(string name, string species, int footsies, string biome, Locomotion locomotion, RelativeElevation elevation) {
this.name = name;
this.species = species;
this.footsies = footsies;
this.biome = biome;
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() {
return RandomItem(new List<string> { "wonderful", "gorgeous", "spectacular", "iconic", "precious", "amazing", "incredible", "wondrous", "fantastic", "impeccable", "admirable", "long", "precious" });
}
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" });
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";
}
output += $", this {RandomCompliment()} {this.species} ";
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" });
output += $" {this.biome}. {this.name} is a {RandomCompliment()} {this.locomotion}, usually found {this.elevation.ToString().ToLower()} sea level. ";
output += RandomItem(new List<string> { "Isn't it", "Truly", "Simply", "Absolutely", "Definitively", "Inspiringly", "Indescribably" });
output += $" {RandomCompliment()}.";
return output;
}
}
}