How to read a stack.peek in order to put it in an if statement C# -


I am trying to create a menu system and I am storing those matches in stacks when they are already Have gone I'm trying to use Stack.Peek () basically: If the menuName = menuStack.Peek, then continue.

The menu is a draw draw, sprite, and menuname calculated with them, and all menu child classes are of the menu class.

  Public static zero GoToMenu (MenuName MenuName) {pile & lt; Menu & gt; Menu stack = new stack & lt; Menu & gt; (); Stack & LT; Menu & gt; TempStack = new stack & lt; Menu & gt; (); If the menu stack.PC () = Main menu) {}}  

More or less, if the menu stack Pike gives a main menu object how do I check it?

I do not know how to read the menu stack. Pek () I do not know how to apply this for a statement that it is equivalent to the main menu object, a Poznanu object or whatever. Public Static Zero GoToMenu (MenuName MenuName) {Stack

Menu Stack = New Stack (); Stack & gt; Menu & gt; TempStack = New stack & lt; menu & gt; (); if (menuStack.Peek () .name == menuName) {menuStack.Pop ();}}

That's what I want


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -