ClirntReadyDataSend

This commit is contained in:
rawer470 2024-08-16 15:39:58 +03:00
parent 580d9a2327
commit 91d15a9de5

View file

@ -7,6 +7,8 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using ZoFo.GameCore.GameObjects;
using ZoFo.GameCore.GameObjects.MapObjects;
namespace ZoFo.GameCore
{
@ -22,21 +24,32 @@ namespace ZoFo.GameCore
}
public void OnDataSend(string data)
{
{
List<IUpdateData> updateDatas = JsonSerializer.Deserialize<List<IUpdateData>>(data);
// тут будет switch
foreach (var item in updateDatas)
{
/* switch (item.UpdateType) Здесь нужно отлавливать и регистрировать
{
case "Tile":
MapObject map = new MapObject();
break;
}*/
}
}
public void GameEndedUnexpectedly(){ }
public void GameEndedUnexpectedly() { }
public void JoinRoom(string ip)
{
networkManager.JoinRoom(ip);
}
public void JoinYourself(){ networkManager.JoinYourself(); }
public void JoinYourself() { networkManager.JoinYourself(); }
internal void Update(GameTime gameTime)
{
}
internal void Draw(SpriteBatch spriteBatch)
{
{
}
}
}