From 6f72c0e97e17ba585e47de4720ac56a0dd64cf8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=B8=D0=BD=D0=BE=D0=B2=20=D0=A1=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B6=D0=B0?= Date: Thu, 15 Aug 2024 15:13:27 +0300 Subject: [PATCH] Connected Systems to AppManager item manager is now public Server got Update(gametime) Client got Update(gametime) and Draw(spriteBatch) Added Commented PlatyerData --- ZoFo/GameCore/Client.cs | 12 ++++++++++ ZoFo/GameCore/GameManagers/AppManager.cs | 20 ++++++++-------- .../GameManagers/ItemManager/ItemManager.cs | 2 +- .../GameManagers/ItemManager/PlayerData.cs | 24 +++++++++++++++++++ ZoFo/GameCore/Server.cs | 7 ++++-- 5 files changed, 52 insertions(+), 13 deletions(-) create mode 100644 ZoFo/GameCore/GameManagers/ItemManager/PlayerData.cs diff --git a/ZoFo/GameCore/Client.cs b/ZoFo/GameCore/Client.cs index f8a9288..c358322 100644 --- a/ZoFo/GameCore/Client.cs +++ b/ZoFo/GameCore/Client.cs @@ -1,4 +1,8 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + namespace ZoFo.GameCore { public class Client @@ -10,5 +14,13 @@ namespace ZoFo.GameCore public void JoinRoom(){ } public void JoinYourself(){ } + + internal void Update(GameTime gameTime) + { + } + + internal void Draw(SpriteBatch spriteBatch) + { + } } } \ No newline at end of file diff --git a/ZoFo/GameCore/GameManagers/AppManager.cs b/ZoFo/GameCore/GameManagers/AppManager.cs index 495a618..54560ae 100644 --- a/ZoFo/GameCore/GameManagers/AppManager.cs +++ b/ZoFo/GameCore/GameManagers/AppManager.cs @@ -8,6 +8,7 @@ using DangerousD.GameCore.Graphics; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; +using ZoFo.GameCore.GameManagers.ItemManager; using ZoFo.GameCore.GUI; using static System.Collections.Specialized.BitVector32; @@ -23,13 +24,14 @@ namespace ZoFo.GameCore.GameManagers public static AppManager Instance { get; private set; } public GameState gamestate; public AbstractGUI currentGUI; - //public Client client; - //public Server server; + public Client client; + public Server server; #region Managers public InputManager InputManager; + public ItemManager.ItemManager ItemManager; public AnimationBuilder animationBuilder{get;set; } @@ -73,17 +75,17 @@ namespace ZoFo.GameCore.GameManagers Exit(); InputManager.Update(); - //currentGUI.Update(); + currentGUI.Update(gameTime); switch (gamestate) { case GameState.NotPlaying: break; case GameState.HostPlaying: - //server.Update(GameTime gameTime); - //client.Update(GameTime gameTime); + server.Update(gameTime); + client.Update(gameTime); break; case GameState.ClientPlaying: - //server.Update(GameTime gameTime); + server.Update(gameTime); break; default: break; @@ -97,12 +99,12 @@ namespace ZoFo.GameCore.GameManagers GraphicsDevice.Clear(Color.CornflowerBlue); - //currentGUI.Draw(_spriteBatch); + currentGUI.Draw(_spriteBatch); switch (gamestate) { case GameState.ClientPlaying: case GameState.HostPlaying: - //client.Draw(_spriteBatch); + client.Draw(_spriteBatch); break; case GameState.NotPlaying: default: @@ -118,8 +120,6 @@ namespace ZoFo.GameCore.GameManagers public void SetGUI(AbstractGUI gui) { currentGUI = gui; - - //TODO } public void GameEnded(Dictionary lootIGot) diff --git a/ZoFo/GameCore/GameManagers/ItemManager/ItemManager.cs b/ZoFo/GameCore/GameManagers/ItemManager/ItemManager.cs index 3585ec4..183c38f 100644 --- a/ZoFo/GameCore/GameManagers/ItemManager/ItemManager.cs +++ b/ZoFo/GameCore/GameManagers/ItemManager/ItemManager.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace ZoFo.GameCore.GameManagers.ItemManager { - class ItemManager + public class ItemManager { //поля Dictionary tagItemPairs; diff --git a/ZoFo/GameCore/GameManagers/ItemManager/PlayerData.cs b/ZoFo/GameCore/GameManagers/ItemManager/PlayerData.cs new file mode 100644 index 0000000..28fb5e9 --- /dev/null +++ b/ZoFo/GameCore/GameManagers/ItemManager/PlayerData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ZoFo.GameCore.GameManagers.ItemManager +{ + /// + /// Класс хранит информацю о количестве ресурсов у игрока + /// + internal class PlayerData + { + Dictionary items; + /// + /// Принимает + /// + /// + public void CraftItem(string itemTag) + { + + } + } +} diff --git a/ZoFo/GameCore/Server.cs b/ZoFo/GameCore/Server.cs index 948ee0e..e1e648d 100644 --- a/ZoFo/GameCore/Server.cs +++ b/ZoFo/GameCore/Server.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.Xna.Framework; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -17,6 +18,8 @@ namespace ZoFo.GameCore public void StartGame() { } public void EndGame() { } - + internal void Update(GameTime gameTime) + { + } } }