Exemplo n.º 1
0
        public static void Announce(STO DateCalc, DateTime FinalDay)
        {
            Console.WriteLine("Todays Date: {0}", DateCalc.Now.ToShortDateString());
            Console.WriteLine("Daily Quests will be available on {0} at {1}", DateCalc.Reset.ToShortDateString(), DateCalc.Reset.ToShortTimeString());
            Console.WriteLine("Estimated date of completion: {0}", DateCalc.DateNeeded().ToShortDateString());
            Console.WriteLine("Days needed to complete the event: {0}", DateCalc.DaysNeeded.Days);

            if (FinalDay < DateCalc.Now)
            {
                Console.WriteLine("There is no way to complete this event, sorry.");
            }
            else if (FinalDay.Day == DateCalc.Now.Day)
            {
                Console.WriteLine("You have to do dailies every day to be able to get enough tokens.");
            }
            Console.WriteLine("The last day to start the event is: {0}", FinalDay.ToShortDateString());
            Console.WriteLine("The event ends on {0}", DateCalc.End.ToShortDateString());
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            ParserResult <Options> result  = Parser.Default.ParseArguments <Options>(args);
            STOFactory             Factory = new STOFactory();
            Date     Dates      = new Date();
            DateTime End        = DateTime.Now + TimeSpan.FromDays(20);
            STO      DateCalc   = Factory.Create(End.ToString(), 20.0f, 20u, 20u, 10u);
            bool     UseOptions = new bool();

            Prompts Prompt = new Prompts("Enter the date that the event ends: ",
                                         "Enter the number of hours until dailies reset: ",
                                         "Enter the number of tokens needed to complete the event: ",
                                         "Enter the number of tokens you currently have: ",
                                         "Enter the number of tokens you get on a daily basis: ");

            ExceptionMsgs ExceptMsgs = new ExceptionMsgs("You must enter a date.",
                                                         "You must enter the number of hours until reset.",
                                                         "You must enter the number of tokens needed to complete the event.",
                                                         "You must enter the number of tokens you currently have.",
                                                         "You must enter the number of tokens you get on a daily basis.");

            result.WithParsed(options =>
            {
                if (options.Quiet == true && options.Json == false && options.PrintJSON == false)
                {
                    options.PrintJSON = true;
                    Console.Error.WriteLine("Neither --json or --print-json were specified, activating --print-json\n");
                }
            });

            UseOptions = result.MapResult(options => {
                if (options.DailyTokens == default &&
                    (options.EndDate == default || string.IsNullOrEmpty(options.EndDate)) &&
                    options.Reset == default &&
                    options.TokensClaimed == default &&
                    options.TotalTokens == default)
                {
                    return(false);
                }