Пример #1
0
        static void Main(string[] args)
        {
            Console.Title = "20180228_1.6_Homework_Beer";

            // DateStuff is a class which contains methods
            // you must declare an instance of the class (I call my instance dateStuff) in order to
            // use the methods within the DateStuff class.
            DateStuff dateStuff = new DateStuff();

            dateStuff.SetLegalAgeDate(21);

            Console.WriteLine("Today's date is {0}", dateStuff.TodaysDate.ToShortDateString());
            Console.WriteLine("To buy alcohol you must have been born on or before {0}", dateStuff.LegalAgeDate.ToShortDateString());

            Console.Write("Enter your birthdate as mm/dd/yyyy: ");
            dateStuff.Birthdate = DateTime.Parse(Console.ReadLine());
            //Console.WriteLine("Your birthdate {0}", DateStuff.Birthdate.ToShortDateString());

            if (dateStuff.BirthdayCheck())
            {
                Console.WriteLine("HAPPY BIRTHDAY!!!!!");
            }

            if (dateStuff.LegalAge())
            {
                Console.WriteLine("Please proceed with your legal alcohol purchase.");
            }
            else
            {
                Console.WriteLine("You are underage and cannot legally purchase alcohol.");
            }

            Console.ReadLine();
        }
Пример #2
0
    public static void TriggerUIUpdate()
    {
        var player = PlayerController.Instance;

        var(day, month, year) = DateStuff.GetDateFormat(player.numDaysPassed);

        // this is damn SEXY!
        string GetAttrStr(int level) => new string('■', level) + new string('□', 5 - level);

        // INFO PANEL
        if (Instance.infoPanel != null)
        {
            Instance.infoPanel.Find("Panel/Info bar").GetComponent <Text>().text =
                $"Day {player.numDaysPassed + 1} - {day}/{month}/{year} - HP {player.CurHP}/{player.MaxHP}" +
                $" - ֎ {player.creds} - ■ {player.attrPts} ({player.CurXP}/10)";
        }

        // CHAR SCREEN
        if (Instance.charScreen != null)
        {
            Instance.charScreen.Find("Panel/Attr Title/Values").GetComponent <Text>().text =
                $"{GetAttrStr(player.strength)}\n{GetAttrStr(player.endurance)}\n{GetAttrStr(player.charisma)}\n■ {player.attrPts}";

            var talent = "---";
            switch (player.talent)
            {
            case PlayerController.Talent.Pilot:
                talent = "PILOT DAD";
                break;

            case PlayerController.Talent.Witty:
                talent = "WITTY";
                break;

            case PlayerController.Talent.Marksman:
                talent = "MARKSMAN";
                break;
            }

            Instance.charScreen.Find("Panel/Vitals Title/Values").GetComponent <Text>().text =
                $"{player.CurHP}/{player.MaxHP}\n֎ {player.creds}\n{player.CurXP}/10\n{talent}";

            Instance.charScreen.Find("Panel/Time Title/Values").GetComponent <Text>().text =
                $"{day}/{DateStuff.DAYS_PER_MONTH}\n{month}/{DateStuff.MONTHS_PER_YEAR}\n{year}\n{player.numDaysPassed}";
        }
    }