IGameObject
This commit is contained in:
parent
42023d71cc
commit
4188745eed
3 changed files with 13 additions and 11 deletions
|
@ -1,11 +1,12 @@
|
|||
using System.Collections.Generic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using MonogameLibrary.UI.Base;
|
||||
|
||||
namespace DangerousD.GameCore.GUI;
|
||||
|
||||
public abstract class AbstractGui : IGui
|
||||
public abstract class AbstractGui : IGameObject
|
||||
{
|
||||
protected UIManager Manager = new();
|
||||
protected List<DrawableUIElement> Elements = new();
|
||||
|
@ -27,7 +28,7 @@ public abstract class AbstractGui : IGui
|
|||
Manager.LoadContent(content);
|
||||
}
|
||||
|
||||
public virtual void Update()
|
||||
public virtual void Update(GameTime gameTime)
|
||||
{
|
||||
Manager.Update();
|
||||
}
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace DangerousD.GameCore.GUI
|
||||
{
|
||||
interface IGui
|
||||
interface IGameObject
|
||||
{
|
||||
void Initialize(GraphicsDevice graphicsDevice);
|
||||
void LoadContent(ContentManager content);
|
||||
void Update();
|
||||
void Update(GameTime gameTime);
|
||||
void Draw(SpriteBatch spriteBatch);
|
||||
}
|
||||
}
|
|
@ -16,9 +16,9 @@ namespace DangerousD.GameCore
|
|||
private SpriteBatch _spriteBatch;
|
||||
|
||||
GameState gameState;
|
||||
IGui MenuGUI;
|
||||
IGui OptionsGUI;
|
||||
IGui LobbyGUI;
|
||||
IGameObject MenuGUI;
|
||||
IGameObject OptionsGUI;
|
||||
IGameObject LobbyGUI;
|
||||
public AppManager()
|
||||
{
|
||||
_graphics = new GraphicsDeviceManager(this);
|
||||
|
@ -50,13 +50,13 @@ namespace DangerousD.GameCore
|
|||
switch (gameState)
|
||||
{
|
||||
case GameState.Menu:
|
||||
MenuGUI.Update();
|
||||
MenuGUI.Update(gameTime);
|
||||
break;
|
||||
case GameState.Options:
|
||||
OptionsGUI.Update();
|
||||
OptionsGUI.Update(gameTime);
|
||||
break;
|
||||
case GameState.Lobby:
|
||||
LobbyGUI.Update();
|
||||
LobbyGUI.Update(gameTime);
|
||||
break;
|
||||
case GameState.Game:
|
||||
GameManager.Update(gameTime);
|
||||
|
|
Loading…
Add table
Reference in a new issue