///<summary> /// returns the Animal info. ///</summary> ///<returns> /// the full Animal info ///</returns> public string GetInfo() { string character = this.GetCharacter(); string animal = ""; animal += new string('#', 50) + "\n"; animal += character + "\n"; animal += "Name: " + this.Name + "\n"; animal += "Alive: " + this.IsAlive() + "\n"; animal += "Sound: " + this.Speak() + "\n"; animal += "Wash time limit: " + (this.LimitWash - Dates.GetDiffInMinutes(this.LastWash)) + "\n"; animal += "Food time limit: " + (this.LimitFood - Dates.GetDiffInMinutes(this.LastFood)) + "\n"; animal += new string('#', 50) + "\n"; return(animal); }
///<summary> /// Returns if a date exceeds a limit. ///</summary> ///<param name="date">date to compare with the current date.</param> ///<param name="limit">difference limit in minutes between the dates.</param> ///<returns> /// true if the difference doesn't exceeds the limit ///</returns> public static bool IsGreatter(DateTime date, int limit) { return(Dates.GetDiffInMinutes(date) > limit); }