Example #1
0
        public void RegisterCommands(ConsoleState cs)
        {
            cs.AddCommand("pause", delegate(ConsoleState cl, string[] args)
            {
                paused = args[0] == "1";
            },
                          "Stops the State Manager from calling any Update or Draw functions on all background states when set to true."
                          );

            cs.AddCommand("focus", delegate(ConsoleState cl, string[] args)
            {
                foreach (State state in states)
                {
                    if (state.GetType().Name == args[0])
                    {
                        focusState.Add(state);
                        return;
                    }
                }
                cl.AddLine("No state of type '" + args[0] + "' exist.");
            },
                          "Adds the first state of type arg0 to the top of the focus stack."
                          );

            cs.AddCommand("dropFocus", delegate(ConsoleState cl, string[] args)
            {
                if (GetFocusedState() != null)
                {
                    DropFocus();
                }
            },
                          "Removes the currently focused state from the top of the focus stack."
                          );

            cs.AddCommand("printFocusStack", delegate(ConsoleState cl, string[] args)
            {
                foreach (State state in focusState)
                {
                    cl.AddLine(state.GetType().Name, state == GetFocusedState() ? Color.Green : Color.White);
                }
            },
                          "Prints the current focus stack to the console window."
                          );

            cs.AddCommand("printStates", delegate(ConsoleState cl, string[] args)
            {
                foreach (State state in states)
                {
                    cl.AddLine(state.GetType().Name, state == GetFocusedState() ? Color.Green : Color.White);
                }
            },
                          "Prints all currently running states to the console window."
                          );
        }
Example #2
0
 public void RegisterCommands(ConsoleState cs)
 {
     cs.AddCommand("count", delegate(ConsoleState cl, string[] args)
     {
         cs.AddLine(alphaParticles.Count.ToString() + " alpha particles.");
         cs.AddLine(additiveParticles.Count.ToString() + " additive particles.");
         cs.AddLine((alphaParticles.Count + additiveParticles.Count).ToString() + " total.", Color.Green);
     },
                   "Shows the total number of existing particles."
                   );
 }
Example #3
0
        public Engine()
            : base()
        {
            MainMenu menu = new MainMenu(this, 0);
            stateManager.StartState(new FadeTransition(this, 1, 0.05f, true, menu));

            console = new ConsoleState(this, 100);
            console.RegisterStateCommands(stateManager);
            stateManager.AddState(console);
            stateManager.Update();

            CorrectBugN();
        }
Example #4
0
        public void RegisterCommands(ConsoleState cs)
        {
            cs.AddCommand("test", delegate(ConsoleState cl, string[] args)
            {
                cl.AddLine("It works!", Color.Blue);
            },
            "A test command defined from an external state."
            );

            cs.AddCommand("menu", delegate(ConsoleState cl, string[] args)
            {
                cs.DeRegisterStateCommands(this);
                cs.DeRegisterStateCommands(pe);
                a.stateManager.EndState(this);
                a.stateManager.StartState(new MainMenu(a, 0));
            },
            "Returns to the main menu."
            );
        }
Example #5
0
 public void RegisterCommands(ConsoleState cs)
 {
     cs.AddCommand("count", delegate(ConsoleState cl, string[] args)
     {
         cs.AddLine(alphaParticles.Count.ToString() + " alpha particles.");
         cs.AddLine(additiveParticles.Count.ToString() + " additive particles.");
         cs.AddLine((alphaParticles.Count + additiveParticles.Count).ToString() + " total.", Color.Green);
     },
     "Shows the total number of existing particles."
     );
 }
Example #6
0
        public void RegisterCommands(ConsoleState cs)
        {
            cs.AddCommand("pause", delegate(ConsoleState cl, string[] args)
            {
                paused = args[0] == "1";
            },
            "Stops the State Manager from calling any Update or Draw functions on all background states when set to true."
            );

            cs.AddCommand("focus", delegate(ConsoleState cl, string[] args)
            {
                foreach (State state in states)
                {
                    if (state.GetType().Name == args[0])
                    {
                        focusState.Add(state);
                        return;
                    }
                }
                cl.AddLine("No state of type '" + args[0] + "' exist.");
            },
            "Adds the first state of type arg0 to the top of the focus stack."
            );

            cs.AddCommand("dropFocus", delegate(ConsoleState cl, string[] args)
            {
                if (GetFocusedState() != null)
                    DropFocus();
            },
            "Removes the currently focused state from the top of the focus stack."
            );

            cs.AddCommand("printFocusStack", delegate(ConsoleState cl, string[] args)
            {
                foreach (State state in focusState)
                {
                    cl.AddLine(state.GetType().Name, state == GetFocusedState() ? Color.Green : Color.White);
                }
            },
            "Prints the current focus stack to the console window."
            );

            cs.AddCommand("printStates", delegate(ConsoleState cl, string[] args)
            {
                foreach (State state in states)
                {
                    cl.AddLine(state.GetType().Name, state == GetFocusedState() ? Color.Green : Color.White);
                }
            },
            "Prints all currently running states to the console window."
            );
        }