Exemple #1
0
        public void SingleDay()
        {
            int    dailyItems = 0;
            string helpString = null;
            Random randomDay  = new Random();

            lib.ReadFile JobStuff = new ReadFile();

            // Runs through the options 3 times
            while (dailyItems < 3)
            {
                // Load the choice menu here
                JobStuff.TextFileManager("assets/data/dailyitems/JobHelp.txt");
                Console.WriteLine("What woudl you like to do today?: ");
                string choice = Console.ReadLine().ToLower();
                if (!choice.Contains("-"))
                {
                    choice = "-" + choice;
                }

                switch (choice)
                {
                case "-school":
                    // Uses a random string
                    string randomString = randomDay.Next(1, 1).ToString();
                    JobStuff.TextFileManager("assets/data/dailyitems/school/school" + randomString + ".txt");

                    break;

                case "-work":
                    break;

                case "-apply":
                    break;

                case "-nothing":
                    break;

                case "-sleep":
                    break;

                default:
                    Console.WriteLine("You pilfer your day away ");
                    break;
                }
                dailyItems++;
            }
        }
        static void Main(string[] args)
        {
            try
            {
                Console.SetWindowSize(110, 50);
            }
            catch (Exception e)
            {
                Console.WriteLine("Could not set window size to 800x600 on account of error,");
                Console.WriteLine(e.Message);
            }

            // Sets the default difficulty to 'normal'
            int difficulty = 2;

            // Displays the Welcome text file
            lib.ReadFile welcomeScreen = new lib.ReadFile();
            welcomeScreen.TextFileManager("assets/data/WelcomeScreen.txt");
            Console.WriteLine("Press 'enter' to continue");
            Console.ReadLine();

            // This is the character selection loader
            try
            {
                lib.ReadFile characterSelect = new lib.ReadFile();
                characterSelect.TextFileManager("assets/data/CharacterSelection.txt");
                Console.WriteLine("Please select difficulty: ");
                difficulty = Convert.ToInt32(Console.ReadLine());
            }
            catch (Exception e)
            {
                Console.WriteLine("Something happend with loading the character loader");
                Console.WriteLine(e.Message);
            }

            // This is the main game loop, this should loop through
            // the game files.
            try
            {
                int selection = 0;
                while (selection == 0)
                {
                    lib.entry.CharacterClassChooser welcome = new lib.entry.CharacterClassChooser();
                    welcome.WelcomeMat(difficulty);
                    selection = difficulty;
                }
                int days = 3;
                int i    = 0;
                while (i < days)
                {
                    // Game logic will go here

                    /*TODO: need to add some game files here,
                     * Also need a way to save variables to be used accross the program*/
                    if (Console.ReadLine() == "-help")
                    {
                        // Display Help message
                    }
                    else
                    {
                        lib.OneDay dayLoader = new OneDay();
                        dayLoader.SingleDay();
                        Console.WriteLine("Day: {0}, only {1} days remain", i, (days - i));
                        Console.ReadLine();
                        Console.WriteLine("Days left: " + (days - i));
                        i++;
                    }
                }
                Console.ReadLine();
            }

            catch (Exception e)
            {
                Console.WriteLine("Something went amiss " + e.Message);
            }
        }