public static void PrintStatus()
        {
            Cat cat3 = new Cat("Ne_Ne_Marusia", new DateTime(2011, 02, 30));

            int leftPosition = Console.CursorLeft;
            int topPosition  = Console.CursorTop;

            for (int i = 0; i < 3; i++)
            {
                string color   = null;
                string message = null;

                message = cat3.GetStatus();
                color   = color.Substring(0, 2);
                color.Replace(" ", "");
                char[] characters = color.ToCharArray();
                Console.SetCursorPosition(0, i);

                Console.Write(message);
                color.Substring(2);
                color.PadRight(50);
                Console.ForegroundColor = 0;
                Console.BackgroundColor = 0;
            }

            Console.SetCursorPosition(0, 3);
            Console.Write($"{foodResource}");

            Console.SetCursorPosition(leftPosition, topPosition);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            CatSmartHouse cat    = new CatSmartHouse(300);
            Cat           Barsik = new Cat("Барсик", new DateTime(2015, 7, 20), 100);

            cat.AddCat(Barsik);
            Barsik.GetStatus();
            Cat Matroskin = new Cat("Матроскин", new DateTime(2012, 8, 23), 100);

            cat.AddCat(Matroskin);
            Matroskin.GetStatus();
            Console.SetCursorPosition(1, 2 + 1);
            Console.ReadLine();
        }
Exemple #3
0
 private void HungryLimit()
 {
     Cat vladik = new Cat("Vladik", new DateTime(2015, 02, 04));
     int corm = Int32.Parse(vladik.GetStatus());
     corm += Int32.Parse(vladik.GetStatus());
 }