Exemple #1
0
 public XleSubMenu(
     IXleGameControl gameControl,
     IMenuRenderer menuRenderer)
 {
     this.gameControl  = gameControl;
     this.menuRenderer = menuRenderer;
 }
Exemple #2
0
		IMenuRenderer CreateRenderer (IMenuRenderer current)
		{
#if NET_4_0
			Type newType = null;
			
			switch (RenderingMode) {
				case MenuRenderingMode.Default:
					if (RenderingCompatibilityLessThan40)
						newType = typeof (MenuTableRenderer);
					else
						newType = typeof (MenuListRenderer);
					break;
					
				case MenuRenderingMode.Table:
					newType = typeof (MenuTableRenderer);
					break;

				case MenuRenderingMode.List:
					newType = typeof (MenuListRenderer);
					break;
			}

			if (newType == null)
				return null;

			if (current == null || current.GetType () != newType)
				return Activator.CreateInstance (newType, this) as IMenuRenderer;
#else
			if (current == null)
				return new MenuTableRenderer (this);
#endif
			return current;
		}
Exemple #3
0
 public ExitOption(Game1 game)
 {
     this.game = game;
     renderer = new TextMenuRenderer(game, "LeafyStencil", "EXIT");
 }
Exemple #4
0
 public ContinueOption(Game1 game)
 {
     this.game = game;
     renderer = new TextMenuRenderer(game, "LeafyStencil", "RESUME");
 }
Exemple #5
0
 public NewGameOption(Game1 game)
 {
     this.game = game;
     renderer = new TextMenuRenderer(game, "LeafyStencil", "NEW GAME");
 }