示例#1
0
        //pauses the game... forEVer!
        public (bool updateBelow, bool shouldClose) Update(InputSet input)
        {
            //it almost really was forever
            //but then I remembered: input identifiers can be passed in!

            bool close = false;

            if (input.Has(closingInput))
            {
                close = true;
            }

            return(false, close);
        }
示例#2
0
        public void Update(InputSet inputs)
        {
            if (retainer != null)
            {
                retainer.HandleRetainedInput(inputs);
            }

            if (screenStack.Count == 0)
            {
                return;
            }

            List <Screen> toClose = new List <Screen>();
            bool          update  = true;

            foreach (Screen screen in screenStack)
            {
                bool close;

                if (update)
                {
                    (update, close) = screen.Update(inputs);
                }
                else
                {
                    close = screen.ShouldClose();
                }

                if (close)
                {
                    toClose.Add(screen);
                }
            }

            foreach (Screen screen in toClose)
            {
                screen.Close();
                screenStack.Remove(screen);
            }
        }
示例#3
0
 public (bool updateBelow, bool shouldClose) Update(InputSet input)
 {
     input.ConsumeAll(); //generally you don't want whatever might be under a loading screen to respond to input
     return(false, hardClose);
 }