Connected Systems to AppManager

item manager is now public
Server got Update(gametime)
Client got Update(gametime) and Draw(spriteBatch)

Added Commented PlatyerData
This commit is contained in:
Сухинов Сережа 2024-08-15 15:13:27 +03:00
parent 4859adadd2
commit 6f72c0e97e
5 changed files with 52 additions and 13 deletions

View file

@ -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)
{
}
}
}

View file

@ -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<string, int> lootIGot)

View file

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace ZoFo.GameCore.GameManagers.ItemManager
{
class ItemManager
public class ItemManager
{
//поля
Dictionary<string, ItemInfo> tagItemPairs;

View file

@ -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
{
/// <summary>
/// Класс хранит информацю о количестве ресурсов у игрока
/// </summary>
internal class PlayerData
{
Dictionary<string, int> items;
/// <summary>
/// Принимает
/// </summary>
/// <param name="itemTag"></param>
public void CraftItem(string itemTag)
{
}
}
}

View file

@ -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)
{
}
}
}