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:
parent
4859adadd2
commit
6f72c0e97e
5 changed files with 52 additions and 13 deletions
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace ZoFo.GameCore
|
namespace ZoFo.GameCore
|
||||||
{
|
{
|
||||||
public class Client
|
public class Client
|
||||||
|
@ -10,5 +14,13 @@ namespace ZoFo.GameCore
|
||||||
public void JoinRoom(){ }
|
public void JoinRoom(){ }
|
||||||
|
|
||||||
public void JoinYourself(){ }
|
public void JoinYourself(){ }
|
||||||
|
|
||||||
|
internal void Update(GameTime gameTime)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void Draw(SpriteBatch spriteBatch)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -8,6 +8,7 @@ using DangerousD.GameCore.Graphics;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
using ZoFo.GameCore.GameManagers.ItemManager;
|
||||||
using ZoFo.GameCore.GUI;
|
using ZoFo.GameCore.GUI;
|
||||||
using static System.Collections.Specialized.BitVector32;
|
using static System.Collections.Specialized.BitVector32;
|
||||||
|
|
||||||
|
@ -23,13 +24,14 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
public static AppManager Instance { get; private set; }
|
public static AppManager Instance { get; private set; }
|
||||||
public GameState gamestate;
|
public GameState gamestate;
|
||||||
public AbstractGUI currentGUI;
|
public AbstractGUI currentGUI;
|
||||||
//public Client client;
|
public Client client;
|
||||||
//public Server server;
|
public Server server;
|
||||||
|
|
||||||
|
|
||||||
#region Managers
|
#region Managers
|
||||||
|
|
||||||
public InputManager InputManager;
|
public InputManager InputManager;
|
||||||
|
public ItemManager.ItemManager ItemManager;
|
||||||
|
|
||||||
public AnimationBuilder animationBuilder{get;set; }
|
public AnimationBuilder animationBuilder{get;set; }
|
||||||
|
|
||||||
|
@ -73,17 +75,17 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
Exit();
|
Exit();
|
||||||
|
|
||||||
InputManager.Update();
|
InputManager.Update();
|
||||||
//currentGUI.Update();
|
currentGUI.Update(gameTime);
|
||||||
switch (gamestate)
|
switch (gamestate)
|
||||||
{
|
{
|
||||||
case GameState.NotPlaying:
|
case GameState.NotPlaying:
|
||||||
break;
|
break;
|
||||||
case GameState.HostPlaying:
|
case GameState.HostPlaying:
|
||||||
//server.Update(GameTime gameTime);
|
server.Update(gameTime);
|
||||||
//client.Update(GameTime gameTime);
|
client.Update(gameTime);
|
||||||
break;
|
break;
|
||||||
case GameState.ClientPlaying:
|
case GameState.ClientPlaying:
|
||||||
//server.Update(GameTime gameTime);
|
server.Update(gameTime);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -97,12 +99,12 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
GraphicsDevice.Clear(Color.CornflowerBlue);
|
GraphicsDevice.Clear(Color.CornflowerBlue);
|
||||||
|
|
||||||
|
|
||||||
//currentGUI.Draw(_spriteBatch);
|
currentGUI.Draw(_spriteBatch);
|
||||||
switch (gamestate)
|
switch (gamestate)
|
||||||
{
|
{
|
||||||
case GameState.ClientPlaying:
|
case GameState.ClientPlaying:
|
||||||
case GameState.HostPlaying:
|
case GameState.HostPlaying:
|
||||||
//client.Draw(_spriteBatch);
|
client.Draw(_spriteBatch);
|
||||||
break;
|
break;
|
||||||
case GameState.NotPlaying:
|
case GameState.NotPlaying:
|
||||||
default:
|
default:
|
||||||
|
@ -118,8 +120,6 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
public void SetGUI(AbstractGUI gui)
|
public void SetGUI(AbstractGUI gui)
|
||||||
{
|
{
|
||||||
currentGUI = gui;
|
currentGUI = gui;
|
||||||
|
|
||||||
//TODO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GameEnded(Dictionary<string, int> lootIGot)
|
public void GameEnded(Dictionary<string, int> lootIGot)
|
||||||
|
|
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.ItemManager
|
namespace ZoFo.GameCore.GameManagers.ItemManager
|
||||||
{
|
{
|
||||||
class ItemManager
|
public class ItemManager
|
||||||
{
|
{
|
||||||
//поля
|
//поля
|
||||||
Dictionary<string, ItemInfo> tagItemPairs;
|
Dictionary<string, ItemInfo> tagItemPairs;
|
||||||
|
|
24
ZoFo/GameCore/GameManagers/ItemManager/PlayerData.cs
Normal file
24
ZoFo/GameCore/GameManagers/ItemManager/PlayerData.cs
Normal 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)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -17,6 +18,8 @@ namespace ZoFo.GameCore
|
||||||
public void StartGame() { }
|
public void StartGame() { }
|
||||||
public void EndGame() { }
|
public void EndGame() { }
|
||||||
|
|
||||||
|
internal void Update(GameTime gameTime)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue