CreachoPedia/Creacher.cs

53 lines
1.6 KiB
C#
Raw Permalink Normal View History

2020-09-07 06:58:48 +00:00
using System;
using Newtonsoft.Json;
2020-09-07 06:58:48 +00:00
namespace creachopedia {
2020-09-27 06:50:09 +00:00
internal enum Locomotion {
None, //barnacles, plants and so on
Walker,
Swimmer,
Hopper,
Flier,
Slitherer,
Incher // snails et al
}
2020-09-27 06:50:09 +00:00
internal enum SurfaceRel {
Below,
At,
Above
}
2020-09-27 06:50:09 +00:00
internal class Creacher {
public string name {get; set;}
[JsonProperty]
private int _footsies { get; set; }
[JsonIgnore]
public int footsies {get { return this._footsies; } set { Console.WriteLine("What do you think you're doing?! 0uo Leave those footsies alone!!!"); }}
public string type = "simple creacher";
2020-09-27 06:50:09 +00:00
private Locomotion locoStyle {get; set;}
private SurfaceRel height {get; set;}
2020-09-07 06:58:48 +00:00
public Creacher(string name, int footsyCount = 4, string biome = "land", Locomotion locoStyle = Locomotion.Walker, SurfaceRel height = SurfaceRel.At) {
2020-09-07 06:58:48 +00:00
this.name = name;
this._footsies = footsyCount;
this.type = $"creacher of the {biome}";
this.locoStyle = locoStyle;
this.height = height;
2020-09-07 06:58:48 +00:00
}
public void Introduce() {
Console.WriteLine($"Hello, my name is... {this.name}. I am a {this.type}, and I have {this.footsies} footsies.");
}
public void Step(){
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.");
}
2020-09-07 06:58:48 +00:00
}
}
}