UpdateGameStartedCommit

This commit is contained in:
AnloGames 2024-09-07 16:06:54 +03:00
parent 8a05554db1
commit 9e013397bd
4 changed files with 24 additions and 3 deletions

View file

@ -184,8 +184,11 @@ namespace ZoFo.GameCore
}
internal void GotData(UpdateData update)
{
if (update is UpdateTileCreated)
if (update is UpdateGameStarted)
{
//Дописать логику
}
else if (update is UpdateTileCreated)
{
mapObjects.Add(
new MapObject(

View file

@ -179,6 +179,10 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
update = token.ToObject<UpdateCreatePlayer>();
data.Add(update);
break;
case "UpdateGameStarted":
update = token.ToObject<UpdateGameStarted>();
data.Add(update);
break;
}
}

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
{
public class UpdateGameStarted : UpdateData
{
public UpdateGameStarted() { UpdateType = "UpdateGameStarted"; }
}
}

View file

@ -28,7 +28,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates
[JsonDerivedType(typeof(UpdateInputInteraction))]
[JsonDerivedType(typeof(UpdateInputShoot))]
[JsonDerivedType(typeof(UpdateCreatePlayer))]
[JsonDerivedType(typeof(UpdateGameStarted))]
public class UpdateData
{
public int IdEntity { get; set; } //Id объекта